From 62e17153c2323fe797f5c312465131a3c4839a04 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 20 Jan 2014 14:44:55 +0000 Subject: [PATCH] Fix exit on last TLW logic after the change of r75633. The changes in this revision meant to prevent the closure of transient dialogs from quitting the application (see #15880) prevented any application using AUI, including the aui sample, from exiting as the AUI utility frames deleted during the main frame destruction were returning false from their IsLastBeforeExit() now. Fix this by relaxing the check and ignoring the parent if it is already being deleted anyhow -- in this case there is no danger of closing it accidentally. Closes #15894. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75656 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/toplvcmn.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/common/toplvcmn.cpp b/src/common/toplvcmn.cpp index d1700c3503..ef693690c5 100644 --- a/src/common/toplvcmn.cpp +++ b/src/common/toplvcmn.cpp @@ -151,8 +151,9 @@ bool wxTopLevelWindowBase::IsLastBeforeExit() const // second, never terminate the application after closing a child TLW // because this would close its parent unexpectedly -- notice that this // check is not redundant with the loop below, as the parent might return - // false from its ShouldPreventAppExit() - if ( GetParent() ) + // false from its ShouldPreventAppExit() -- except if the child is being + // deleted as part of the parent destruction + if ( GetParent() && !GetParent()->IsBeingDeleted() ) return false; wxWindowList::const_iterator i;