mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
fix segfault on exit if any closable tabs were open (#5435)
This commit is contained in:
parent
2b3c47148e
commit
1a3df84f0a
1 changed files with 18 additions and 9 deletions
|
|
@ -304,19 +304,28 @@ void TabSupervisor::stop()
|
|||
tabAdmin = 0;
|
||||
tabLog = 0;
|
||||
|
||||
QMapIterator<int, TabRoom *> roomIterator(roomTabs);
|
||||
while (roomIterator.hasNext())
|
||||
roomIterator.next().value()->deleteLater();
|
||||
for (const auto tab : deckEditorTabs) {
|
||||
disconnect(tab, nullptr, this, nullptr);
|
||||
tab->deleteLater();
|
||||
}
|
||||
deckEditorTabs.clear();
|
||||
|
||||
for (auto i = roomTabs.cbegin(), end = roomTabs.cend(); i != end; ++i) {
|
||||
disconnect(i.value(), nullptr, this, nullptr);
|
||||
i.value()->deleteLater();
|
||||
}
|
||||
roomTabs.clear();
|
||||
|
||||
QMapIterator<int, TabGame *> gameIterator(gameTabs);
|
||||
while (gameIterator.hasNext())
|
||||
gameIterator.next().value()->deleteLater();
|
||||
for (auto i = gameTabs.cbegin(), end = gameTabs.cend(); i != end; ++i) {
|
||||
disconnect(i.value(), nullptr, this, nullptr);
|
||||
i.value()->deleteLater();
|
||||
}
|
||||
gameTabs.clear();
|
||||
|
||||
QListIterator<TabGame *> replayIterator(replayTabs);
|
||||
while (replayIterator.hasNext())
|
||||
replayIterator.next()->deleteLater();
|
||||
for (const auto tab : replayTabs) {
|
||||
disconnect(tab, nullptr, this, nullptr);
|
||||
tab->deleteLater();
|
||||
}
|
||||
replayTabs.clear();
|
||||
|
||||
delete userInfo;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue