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

@ -304,30 +304,27 @@ void TabSupervisor::stop()
tabAdmin = 0;
tabLog = 0;
for (const auto tab : deckEditorTabs) {
disconnect(tab, nullptr, this, nullptr);
tab->deleteLater();
}
deckEditorTabs.clear();
QList<Tab *> tabsToDelete;
for (auto i = roomTabs.cbegin(), end = roomTabs.cend(); i != end; ++i) {
disconnect(i.value(), nullptr, this, nullptr);
i.value()->deleteLater();
tabsToDelete << i.value();
}
roomTabs.clear();
for (auto i = gameTabs.cbegin(), end = gameTabs.cend(); i != end; ++i) {
disconnect(i.value(), nullptr, this, nullptr);
i.value()->deleteLater();
tabsToDelete << i.value();
}
gameTabs.clear();
for (const auto tab : replayTabs) {
disconnect(tab, nullptr, this, nullptr);
tab->deleteLater();
tabsToDelete << tab;
}
replayTabs.clear();
for (const auto tab : tabsToDelete) {
tab->closeRequest(true);
}
delete userInfo;
userInfo = 0;
}