mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 00:54:53 -07:00
Fix segfault when game is closed while card view window is open (#5507)
This commit is contained in:
parent
b004e91aa4
commit
aeb1b9fb4f
9 changed files with 26 additions and 40 deletions
|
|
@ -564,9 +564,6 @@ Player::~Player()
|
|||
{
|
||||
qCDebug(PlayerLog) << "Player destructor:" << getName();
|
||||
|
||||
static_cast<GameScene *>(scene())->removePlayer(this);
|
||||
|
||||
clear();
|
||||
QMapIterator<QString, CardZone *> i(zones);
|
||||
while (i.hasNext())
|
||||
delete i.next().value();
|
||||
|
|
@ -2086,7 +2083,7 @@ void Player::eventShuffle(const Event_Shuffle &event)
|
|||
int length = view->getCards().length();
|
||||
// we want to close empty views as well
|
||||
if (length == 0 || length > absStart) { // note this assumes views always start at the top of the library
|
||||
view->deleteLater();
|
||||
view->close();
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue