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
This commit is contained in:
parent
527ac36129
commit
45cf08111a
1 changed files with 2 additions and 1 deletions
|
@ -390,7 +390,8 @@ void CardItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||||
{
|
{
|
||||||
if (event->button() == Qt::RightButton) {
|
if (event->button() == Qt::RightButton) {
|
||||||
if (cardMenu != nullptr && !cardMenu->isEmpty() && owner != nullptr) {
|
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) &&
|
} else if ((event->modifiers() != Qt::AltModifier) && (event->button() == Qt::LeftButton) &&
|
||||||
(!SettingsCache::instance().getDoubleClickToPlay())) {
|
(!SettingsCache::instance().getDoubleClickToPlay())) {
|
||||||
|
|
Loading…
Reference in a new issue