From 7e1a702bc796d9fde2d3b395bef5b2ac5cfecf3c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 7 Feb 2014 14:35:41 +0000 Subject: [PATCH] Fix exit on last TLW logic after the change of r75630. 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/branches/WX_3_0_BRANCH@75832 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 11920925f2..3503a15ddc 100644 --- a/src/common/toplvcmn.cpp +++ b/src/common/toplvcmn.cpp @@ -141,8 +141,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;