소스 검색

Avoid creation of new threads without mutex protection

Ivan Savenko 1 년 전
부모
커밋
3b3c4860b2
1개의 변경된 파일4개의 추가작업 그리고 6개의 파일을 삭제
  1. 4 6
      client/adventureMap/AdventureMapInterface.cpp

+ 4 - 6
client/adventureMap/AdventureMapInterface.cpp

@@ -441,12 +441,10 @@ void AdventureMapInterface::onPlayerTurnStarted(PlayerColor playerID)
 		if(auto iw = GH.windows().topWindow<CInfoWindow>())
 			iw->close();
 
-		boost::thread newThread([this]()
-			{
-				hotkeyEndingTurn();
-			});
-
-		newThread.detach();
+		GH.dispatchMainThread([this]()
+		{
+			hotkeyEndingTurn();
+		});
 	}
 }