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;