the app doesn't exit any more if a dialog is shown (and destroyed) while

the flow of control is still in OnInit()


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16523 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2002-08-15 20:42:07 +00:00
parent 62b77e42be
commit 1cbee0b42c
10 changed files with 134 additions and 89 deletions

View File

@@ -701,22 +701,8 @@ int wxEntry(WXHINSTANCE hInstance,
wxLog::SetTimestamp(NULL);
#endif
int retValue = 0;
// it is common to create a modal dialog in OnInit() (to ask/notify the
// user about something) but it wouldn't work if we don't change the
// "exit on delete last frame" flag here as when this dialog is
// deleted, the app would terminate (it was the last top level window
// as the main frame wasn't created yet!), so disable this behaviour
// temproarily
bool exitOnLastFrameDelete = wxTheApp->GetExitOnFrameDelete();
wxTheApp->SetExitOnFrameDelete(FALSE);
// init the app
retValue = wxEntryInitGui() && wxTheApp->OnInit() ? 0 : -1;
// restore the old flag value
wxTheApp->SetExitOnFrameDelete(exitOnLastFrameDelete);
int retValue = wxEntryInitGui() && wxTheApp->OnInit() ? 0 : -1;
if ( retValue == 0 )
{
@@ -986,8 +972,8 @@ bool wxApp::ProcessIdle()
void wxApp::ExitMainLoop()
{
// VZ: why not ::PostQuitMessage()?
m_keepGoing = FALSE;
// this will set m_keepGoing to FALSE a bit later
::PostQuitMessage(0);
}
bool wxApp::Pending()