summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-09-22 00:46:29 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-09-22 00:46:29 +0200
commitbd1e8bf16639eda528df671e64447febbcffd10a (patch)
treea671414f8f624acfeb1db81a43a13ba1b780fc37
parente61aa017456b8e5532a7d9a94ca7b2af9d4eecd1 (diff)
downloadserenity-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.cpp1
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;
}