1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 12:57:35 +00:00

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 1074c399f3 the command palette
dialog would handle a WindowBecameInactive event after closing itself
due to the action already being called.
This commit is contained in:
networkException 2022-04-26 20:41:51 +02:00 committed by Linus Groh
parent cd3e337487
commit 64c66e26f5

View file

@ -116,7 +116,7 @@ void Dialog::event(Core::Event& event)
void Dialog::close() void Dialog::close()
{ {
Window::close(); Window::close();
m_event_loop->quit(ExecCancel); done(ExecCancel);
} }
} }