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:
RickyRister 2025-01-11 19:19:45 -08:00 committed by GitHub
parent 3b544a36a8
commit 7347ba88ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 59 additions and 67 deletions

View file

@ -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()