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
|
|
@ -51,7 +51,7 @@ Server_Game::~Server_Game()
|
|||
|
||||
QMapIterator<int, Server_Player *> playerIterator(players);
|
||||
while (playerIterator.hasNext())
|
||||
delete playerIterator.next().value();
|
||||
playerIterator.next().value()->prepareDestroy();
|
||||
players.clear();
|
||||
|
||||
room->removeGame(this);
|
||||
|
|
@ -243,7 +243,7 @@ void Server_Game::removePlayer(Server_Player *player)
|
|||
sendGameEvent(new Event_Leave(player->getPlayerId()));
|
||||
bool playerActive = activePlayer == player->getPlayerId();
|
||||
bool spectator = player->getSpectator();
|
||||
delete player;
|
||||
player->prepareDestroy();
|
||||
|
||||
if (!getPlayerCount())
|
||||
deleteLater();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue