mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-09 21:40:34 +01:00
Only use CallOnInit the first time, otherwise the 2nd wx.App will block when being constructed. Fixes hang in unittests.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@77977 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -242,7 +242,6 @@ void wxPyApp::_BootstrapApp()
|
||||
);
|
||||
goto error;
|
||||
}
|
||||
haveInitialized = true;
|
||||
}
|
||||
else {
|
||||
this->argc = 0;
|
||||
@@ -253,11 +252,23 @@ void wxPyApp::_BootstrapApp()
|
||||
|
||||
// Call the Python wxApp's OnPreInit and OnInit functions if they exist
|
||||
OnPreInit();
|
||||
result = CallOnInit();
|
||||
|
||||
#ifdef __WXOSX_COCOA__
|
||||
// Only use CallOnInit the first time, otherwise it will block on [NSApp run];
|
||||
if (! haveInitialized)
|
||||
result = CallOnInit();
|
||||
else
|
||||
#endif
|
||||
result = OnInit();
|
||||
//#ifdef __WXOSX_COCOA__
|
||||
// OSXSetInitWasCalled(true); TODO: consider adding this method to wxApp
|
||||
//#endif
|
||||
|
||||
if (! result) {
|
||||
wxPyErr_SetString(PyExc_SystemExit, "OnInit returned false, exiting...");
|
||||
}
|
||||
|
||||
haveInitialized = true;
|
||||
|
||||
error:
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user