server mutex fix

This commit is contained in:
Max-Wilhelm Bruker
2011-04-21 02:04:15 +02:00
parent 38b31681e2
commit c4ba33dfeb
3 changed files with 12 additions and 3 deletions

View File

@@ -16,17 +16,25 @@ Server_Player::Server_Player(Server_Game *_game, int _playerId, ServerInfo_User
}
Server_Player::~Server_Player()
{
}
void Server_Player::prepareDestroy()
{
QMutexLocker locker(&game->gameMutex);
QMutexLocker locker2(&playerMutex);
delete deck;
playerMutex.lock();
if (handler)
handler->playerRemovedFromGame(game);
playerMutex.unlock();
delete userInfo;
clearZones();
deleteLater();
}
void Server_Player::moveToThread(QThread *thread)