summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornetworkException <git@nwex.de>2022-04-26 20:41:51 +0200
committerLinus Groh <mail@linusgroh.de>2022-04-26 22:41:44 +0200
commit64c66e26f5d817b9e95aa1faa6d883c9805dcedc (patch)
treee6998c89c5ce60b3ac10b9824bfb3d801c2ed9dc
parentcd3e337487ee6b05f1a29931da5fca8ecab9cb9e (diff)
downloadserenity-64c66e26f5d817b9e95aa1faa6d883c9805dcedc.zip
LibGUI: Check if event loop is alive before quitting it in Dialog::close
Previously we would quit the event loop of a dialog without checking if it is still alive in the Window::close overload. This patch updates the implementation to make use of the existing done method, handling closes more gracefully. This fixes a CommandPalette crashing when opening an about dialog, as since 1074c399f37be9c2e56215f7defaa1aa2eed125b the command palette dialog would handle a WindowBecameInactive event after closing itself due to the action already being called.
-rw-r--r--Userland/Libraries/LibGUI/Dialog.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibGUI/Dialog.cpp b/Userland/Libraries/LibGUI/Dialog.cpp
index 07d6cdb36c..d4e7e65631 100644
--- a/Userland/Libraries/LibGUI/Dialog.cpp
+++ b/Userland/Libraries/LibGUI/Dialog.cpp
@@ -116,7 +116,7 @@ void Dialog::event(Core::Event& event)
void Dialog::close()
{
Window::close();
- m_event_loop->quit(ExecCancel);
+ done(ExecCancel);
}
}