Avoid automatically closing parent frame if a child dialog was closed.

This counterintuitive behaviour could happen when a dialog of a frame
returning false from its ShouldPreventAppExit() was closed: if there were no
other TLWs in the application, then the parent frame could be closed as well,
even if this clearly shouldn't happen.

See #15880.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75633 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2014-01-16 21:44:47 +00:00
parent 575481d06b
commit 55759171de

View File

@ -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();