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
This commit is contained in:
Vadim Zeitlin
2014-01-20 14:44:55 +00:00
parent a81511317b
commit 62e17153c2

View File

@@ -151,8 +151,9 @@ bool wxTopLevelWindowBase::IsLastBeforeExit() const
// second, never terminate the application after closing a child TLW // second, never terminate the application after closing a child TLW
// because this would close its parent unexpectedly -- notice that this // because this would close its parent unexpectedly -- notice that this
// check is not redundant with the loop below, as the parent might return // check is not redundant with the loop below, as the parent might return
// false from its ShouldPreventAppExit() // false from its ShouldPreventAppExit() -- except if the child is being
if ( GetParent() ) // deleted as part of the parent destruction
if ( GetParent() && !GetParent()->IsBeingDeleted() )
return false; return false;
wxWindowList::const_iterator i; wxWindowList::const_iterator i;