mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Avoid creation of new threads without mutex protection
This commit is contained in:
parent
aa2934853f
commit
3b3c4860b2
@ -441,12 +441,10 @@ void AdventureMapInterface::onPlayerTurnStarted(PlayerColor playerID)
|
|||||||
if(auto iw = GH.windows().topWindow<CInfoWindow>())
|
if(auto iw = GH.windows().topWindow<CInfoWindow>())
|
||||||
iw->close();
|
iw->close();
|
||||||
|
|
||||||
boost::thread newThread([this]()
|
GH.dispatchMainThread([this]()
|
||||||
{
|
{
|
||||||
hotkeyEndingTurn();
|
hotkeyEndingTurn();
|
||||||
});
|
});
|
||||||
|
|
||||||
newThread.detach();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user