Browse Source

ticker: fix a crash upon exit on Windows.

We need to ensure the inter-thread messaging queues are empty (more
specifically, not locked) before destroying them. The best way to ensure
that is to explicitly wait for thread termination.
legacy
Sam Hocevar 6 years ago
parent
commit
4c20271dc7
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      src/engine/ticker.cpp

+ 2
- 1
src/engine/ticker.cpp View File

@@ -49,6 +49,8 @@ public:
#if LOL_FEATURE_THREADS #if LOL_FEATURE_THREADS
gametick.push(0); gametick.push(0);
disktick.push(0); disktick.push(0);
gamethread.release();
diskthread.release();
#endif #endif
} }


@@ -82,7 +84,6 @@ private:
void GameThreadMain(); void GameThreadMain();
void DrawThreadMain(); /* unused for now */ void DrawThreadMain(); /* unused for now */
void DiskThreadMain(); void DiskThreadMain();
thread *drawthread;
std::unique_ptr<thread> gamethread, diskthread; std::unique_ptr<thread> gamethread, diskthread;
queue<int> gametick, drawtick, disktick; queue<int> gametick, drawtick, disktick;
#endif #endif


||||||
x
 
000:0
Loading…
Cancel
Save