From 45cf08111a8131dec8a9c81db397f257eda902b9 Mon Sep 17 00:00:00 2001 From: ebbit1q Date: Mon, 17 Oct 2022 22:38:44 +0200 Subject: [PATCH] fix crash when a cardmenu becomes an orphan (#4682) * fix crash when a cardmenu becomes an orphan when a cardmenu is closed the cursor on that card reverts to the open hand, this crashed the client when that card would be destroyed or moved the act of reverting to the open hand now happens as an emitted signal, this way it just doesn't exist anymore when the card is deleted. * simplify fix --- cockatrice/src/carditem.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cockatrice/src/carditem.cpp b/cockatrice/src/carditem.cpp index fea3166e..de3a0458 100644 --- a/cockatrice/src/carditem.cpp +++ b/cockatrice/src/carditem.cpp @@ -390,7 +390,8 @@ void CardItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { if (event->button() == Qt::RightButton) { if (cardMenu != nullptr && !cardMenu->isEmpty() && owner != nullptr) { - cardMenu->exec(event->screenPos()); + cardMenu->popup(event->screenPos()); + return; } } else if ((event->modifiers() != Qt::AltModifier) && (event->button() == Qt::LeftButton) && (!SettingsCache::instance().getDoubleClickToPlay())) {