瀏覽代碼

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.
thankyouverycool 2 年之前
父節點
當前提交
5c92397
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      Userland/Libraries/LibGUI/Dialog.cpp

+ 2 - 1
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);
 }