Improve thread safety.

This commit is contained in:
lotodore
2011-01-12 23:35:45 +00:00
parent b6c820718a
commit 2a7456998a
10 changed files with 51 additions and 39 deletions
+3
View File
@@ -1732,6 +1732,9 @@ ClientStateWaitHand::InternalHandlePacket(boost::shared_ptr<ClientThread> client
cardDataStream >> myCards[0];
cardDataStream >> myCards[1];
}
// Basic synchronisation before a new hand is started.
client->GetGui().waitForGuiUpdateDone();
// Start new hand.
client->GetGame()->getSeatsList()->front()->setMyCards(myCards);
client->GetGame()->initHand();
client->GetGame()->getCurrentHand()->setSmallBlind(netHandStart->smallBlind);
+1 -1
View File
@@ -1219,7 +1219,7 @@ void
ClientThread::RemoveDisconnectedPlayers()
{
// This should only be called between hands.
if (m_game.get())
if (m_game)
{
PlayerListIterator it;
for (it = m_game->getSeatsList()->begin(); it != m_game->getSeatsList()->end(); it++)