Skip to content

Commit

Permalink
fix: ignore save requests after closing all windows (#5081)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nerixyz authored Jan 14, 2024
1 parent 13ff11e commit 292f9b9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
- Bugfix: Fixed avatar in usercard and moderation button triggering when releasing the mouse outside their area. (#5052)
- Bugfix: Fixed moderator-only topics being subscribed to for non-moderators. (#5056)
- Bugfix: Fixed a bug where buttons would remain in a hovered state after leaving them. (#5077)
- Bugfix: Fixed popup windows not persisting between restarts. (#5081)
- Bugfix: Fixed splits not retaining their focus after minimizing. (#5080)
- Dev: Run miniaudio in a separate thread, and simplify it to not manage the device ourselves. There's a chance the simplification is a bad idea. (#4978)
- Dev: Change clang-format from v14 to v16. (#4929)
Expand Down
12 changes: 11 additions & 1 deletion src/singletons/WindowManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,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;

Expand Down Expand Up @@ -700,6 +707,9 @@ void WindowManager::closeAll()
{
assertInGuiThread();

qCDebug(chatterinoWindowmanager) << "Shutting down (closing windows)";
this->shuttingDown_ = true;

for (Window *window : windows_)
{
window->close();
Expand Down
1 change: 1 addition & 0 deletions src/singletons/WindowManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ class WindowManager final : public Singleton
const QString windowLayoutFilePath;

bool initialized_ = false;
bool shuttingDown_ = false;

QPoint emotePopupPos_;

Expand Down

0 comments on commit 292f9b9

Please sign in to comment.