diff --git a/src/common/toplvcmn.cpp b/src/common/toplvcmn.cpp index fc1609e06c..d1700c3503 100644 --- a/src/common/toplvcmn.cpp +++ b/src/common/toplvcmn.cpp @@ -148,6 +148,13 @@ bool wxTopLevelWindowBase::IsLastBeforeExit() const if ( !wxTheApp || !wxTheApp->GetExitOnFrameDelete() ) return false; + // 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() ) + return false; + wxWindowList::const_iterator i; const wxWindowList::const_iterator end = wxTopLevelWindows.end();