diff --git a/cockatrice/src/client/tabs/tab_supervisor.cpp b/cockatrice/src/client/tabs/tab_supervisor.cpp index 7d946f713..3a740afdf 100644 --- a/cockatrice/src/client/tabs/tab_supervisor.cpp +++ b/cockatrice/src/client/tabs/tab_supervisor.cpp @@ -251,9 +251,9 @@ void TabSupervisor::closeEvent(QCloseEvent *event) // Close the game tabs in order to make sure they store their layout. QSet gameTabsToRemove; - for (auto [tabId, tab] : gameTabs.asKeyValueRange()) { - if (tab->close()) { - gameTabsToRemove.insert(tabId); + for (auto it = gameTabs.keyValueBegin(), end = gameTabs.keyValueEnd(); it != end; ++it) { + if (it->second->close()) { + gameTabsToRemove.insert(it->first); } else { event->ignore(); }