fix: ignore save requests after closing all windows

This commit is contained in:
Nerixyz 2024-01-13 22:58:44 +01:00
parent 1554d7b6a4
commit f08d1826bb
No known key found for this signature in database
GPG key ID: 946BA188C5609CCC
2 changed files with 12 additions and 1 deletions

View file

@ -422,7 +422,14 @@ void WindowManager::save()
{
return;
}
qCDebug(chatterinoWindowmanager) << "[WindowManager] Saving";
if (this->shuttingDown_)
{
qCDebug(chatterinoWindowmanager) << "Skipping save (shutting down)";
return;
}
qCDebug(chatterinoWindowmanager) << "Saving";
assertInGuiThread();
QJsonDocument document;
@ -701,6 +708,9 @@ void WindowManager::closeAll()
{
assertInGuiThread();
qCDebug(chatterinoWindowmanager) << "Shutting down (closing windows)";
this->shuttingDown_ = true;
for (Window *window : windows_)
{
window->close();

View file

@ -140,6 +140,7 @@ private:
const QString windowLayoutFilePath;
bool initialized_ = false;
bool shuttingDown_ = false;
QPoint emotePopupPos_;