diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-09-22 00:46:29 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-09-22 00:46:29 +0200 |
commit | bd1e8bf16639eda528df671e64447febbcffd10a (patch) | |
tree | a671414f8f624acfeb1db81a43a13ba1b780fc37 | |
parent | e61aa017456b8e5532a7d9a94ca7b2af9d4eecd1 (diff) | |
download | serenity-bd1e8bf16639eda528df671e64447febbcffd10a.zip |
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.
-rw-r--r-- | Libraries/LibGUI/GDialog.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Libraries/LibGUI/GDialog.cpp b/Libraries/LibGUI/GDialog.cpp index eaa3359f39..a3cd4a5e0f 100644 --- a/Libraries/LibGUI/GDialog.cpp +++ b/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; } |