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:
parent
575481d06b
commit
55759171de
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user