mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
server mutex fix
This commit is contained in:
parent
38b31681e2
commit
c4ba33dfeb
3 changed files with 12 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue