mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
fix segfault on disconnect (#5447)
* add new param to closeRequest * don't emit signals in dtors * send closeRequest * fix build failure * fix build failure * see if we can get away with the overloaded triggered * fix build failure
This commit is contained in:
parent
3b544a36a8
commit
7347ba88ac
12 changed files with 59 additions and 67 deletions
|
|
@ -358,7 +358,7 @@ void TabDeckEditor::createMenus()
|
|||
analyzeDeckMenu->addAction(aAnalyzeDeckTappedout);
|
||||
|
||||
aClose = new QAction(QString(), this);
|
||||
connect(aClose, SIGNAL(triggered()), this, SLOT(closeRequest()));
|
||||
connect(aClose, &QAction::triggered, this, [this] { closeRequest(); });
|
||||
|
||||
aClearFilterAll = new QAction(QString(), this);
|
||||
aClearFilterAll->setIcon(QPixmap("theme:icons/clearsearch"));
|
||||
|
|
@ -721,11 +721,6 @@ TabDeckEditor::TabDeckEditor(TabSupervisor *_tabSupervisor, QWidget *parent)
|
|||
loadLayout();
|
||||
}
|
||||
|
||||
TabDeckEditor::~TabDeckEditor()
|
||||
{
|
||||
emit deckEditorClosing(this);
|
||||
}
|
||||
|
||||
void TabDeckEditor::retranslateUi()
|
||||
{
|
||||
cardInfo->retranslateUi();
|
||||
|
|
@ -980,10 +975,14 @@ bool TabDeckEditor::confirmClose()
|
|||
return true;
|
||||
}
|
||||
|
||||
void TabDeckEditor::closeRequest()
|
||||
void TabDeckEditor::closeRequest(bool forced)
|
||||
{
|
||||
if (confirmClose())
|
||||
deleteLater();
|
||||
if (!forced && !confirmClose()) {
|
||||
return;
|
||||
}
|
||||
|
||||
emit deckEditorClosing(this);
|
||||
deleteLater();
|
||||
}
|
||||
|
||||
void TabDeckEditor::actNewDeck()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue