Ver código fonte

GDialog: Remove self from parent when the nested event loop returns

This ensures that we close (and don't leak) the dialog during the
typical usage pattern.
Andreas Kling 5 anos atrás
pai
commit
bd1e8bf166
1 arquivos alterados com 1 adições e 0 exclusões
  1. 1 0
      Libraries/LibGUI/GDialog.cpp

+ 1 - 0
Libraries/LibGUI/GDialog.cpp

@@ -29,6 +29,7 @@ int GDialog::exec()
     auto result = m_event_loop->exec();
     m_event_loop = nullptr;
     dbgprintf("%s: event loop returned with result %d\n", class_name(), result);
+    remove_from_parent();
     return result;
 }