From bd1e8bf16639eda528df671e64447febbcffd10a Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 22 Sep 2019 00:46:29 +0200 Subject: [PATCH] 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. --- Libraries/LibGUI/GDialog.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/Libraries/LibGUI/GDialog.cpp b/Libraries/LibGUI/GDialog.cpp index eaa3359f399..a3cd4a5e0f8 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; }