Fix segfault when game is closed while card view window is open (#5507)

This commit is contained in:
RickyRister 2025-01-20 19:06:55 -08:00 committed by GitHub
parent b004e91aa4
commit aeb1b9fb4f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 26 additions and 40 deletions

View file

@ -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 {