mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-14 22:42:14 -07:00
Put mutex around returning cards on concede
This commit is contained in:
parent
cee67f4301
commit
26339aa9d3
1 changed files with 4 additions and 0 deletions
|
|
@ -920,6 +920,8 @@ Server_Player::cmdConcede(const Command_Concede & /*cmd*/, ResponseContainer & /
|
||||||
game->removeArrowsRelatedToPlayer(ges, this);
|
game->removeArrowsRelatedToPlayer(ges, this);
|
||||||
game->unattachCards(ges, this);
|
game->unattachCards(ges, this);
|
||||||
|
|
||||||
|
playerMutex.lock();
|
||||||
|
|
||||||
// Return cards to their rightful owners before conceding the game
|
// Return cards to their rightful owners before conceding the game
|
||||||
static const QRegularExpression ownerRegex{"Owner: ?([^\n]+)"};
|
static const QRegularExpression ownerRegex{"Owner: ?([^\n]+)"};
|
||||||
for (const auto &card : zones.value("table")->getCards()) {
|
for (const auto &card : zones.value("table")->getCards()) {
|
||||||
|
|
@ -959,6 +961,8 @@ Server_Player::cmdConcede(const Command_Concede & /*cmd*/, ResponseContainer & /
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
playerMutex.unlock();
|
||||||
|
|
||||||
// All borrowed cards have been returned, can now continue cleanup process
|
// All borrowed cards have been returned, can now continue cleanup process
|
||||||
clearZones();
|
clearZones();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue