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:
@@ -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()
|
||||
|
Reference in New Issue
Block a user