From 5c923977b71fd12ef0c0b40a96734f4f423f601d Mon Sep 17 00:00:00 2001 From: thankyouverycool <66646555+thankyouverycool@users.noreply.github.com> Date: Thu, 17 Nov 2022 09:17:30 -0500 Subject: 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. --- Userland/Libraries/LibGUI/Dialog.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Userland') 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); } -- cgit v1.2.3