diff options
author | thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> | 2022-11-17 09:17:30 -0500 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-11-19 16:04:42 +0100 |
commit | 5c923977b71fd12ef0c0b40a96734f4f423f601d (patch) | |
tree | b4545c07062de7b1baf19bfcf8a73d759271b293 /Userland | |
parent | 2028fbeae33118cdff6c554dfb2f098150209ff4 (diff) | |
download | serenity-5c923977b71fd12ef0c0b40a96734f4f423f601d.zip |
LibGUI: Always close() Dialogs no matter the execution result
Fixes Blocking modal race conditions when new windows are created
in the same scope as Dialogs.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibGUI/Dialog.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/Libraries/LibGUI/Dialog.cpp b/Userland/Libraries/LibGUI/Dialog.cpp index 199ea47326..90147459a7 100644 --- a/Userland/Libraries/LibGUI/Dialog.cpp +++ b/Userland/Libraries/LibGUI/Dialog.cpp @@ -112,6 +112,8 @@ Dialog::ExecResult Dialog::exec() void Dialog::done(ExecResult result) { + Window::close(); + if (!m_event_loop) return; m_result = result; @@ -137,7 +139,6 @@ void Dialog::event(Core::Event& event) void Dialog::close() { - Window::close(); done(ExecResult::Cancel); } |