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
Notes: sideshowbarker 2024-07-17 11:31:28 +09:00

View File

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