From 64c66e26f5d817b9e95aa1faa6d883c9805dcedc Mon Sep 17 00:00:00 2001 From: networkException Date: Tue, 26 Apr 2022 20:41:51 +0200 Subject: 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. --- Userland/Libraries/LibGUI/Dialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Userland/Libraries/LibGUI/Dialog.cpp') 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); } } -- cgit v1.2.3