|
From: Lasse Kärkkäi. <tr...@us...> - 2009-08-18 03:36:04
|
Module: performous
Branch: master
Commit: 2c8d540da7b1b3096946ee9cbe60aabb8ab83d1d
Author: Lasse Karkkainen <tro...@tr...>
Date: Tue Aug 18 06:35:04 2009 +0300
Make Engine::kill block until the thread has terminated to avoid a crash in
the new score dialog code.
---
game/engine.hh | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/game/engine.hh b/game/engine.hh
index 19c91ef..0160c44 100644
--- a/game/engine.hh
+++ b/game/engine.hh
@@ -56,9 +56,9 @@ class Engine {
for (std::list<Player>::iterator it = m_players.cur.begin(); it != m_players.cur.end(); ++it, ++player) it->m_color = playerColors[player % playerColorsSize];
m_thread.reset(new boost::thread(boost::ref(*this)));
}
- ~Engine() { kill(); m_thread->join(); }
+ ~Engine() { kill(); }
/// Terminates processing
- void kill() { m_quit = true; }
+ void kill() { m_quit = true; m_thread->join(); }
/** Used internally for boost::thread. Do not call this yourself. (boost::thread requires this to be public). **/
void operator()() {
while (!m_quit) {
|