X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/36a73f1d03da134576745556f464f54321b3aa40..e41e579f40ec15c8c20aa3118b7367281ae4f95b:/wxPython/src/helpers.cpp diff --git a/wxPython/src/helpers.cpp b/wxPython/src/helpers.cpp index 1e7a62009d..18a46a2f83 100644 --- a/wxPython/src/helpers.cpp +++ b/wxPython/src/helpers.cpp @@ -115,9 +115,6 @@ int wxPyApp::MainLoop() { DeletePendingObjects(); bool initialized = wxTopLevelWindows.GetCount() != 0; -#ifdef __WXGTK__ - m_initialized = initialized; -#endif if (initialized) { if ( m_exitOnFrameDelete == Later ) { @@ -365,6 +362,10 @@ void __wxPreStart(PyObject* moduleDict) PyEval_InitThreads(); wxPyTStates = new wxPyThreadStateArray; wxPyTMutex = new wxMutex; + + // Save the current (main) thread state in our array + PyThreadState* tstate = wxPyBeginAllowThreads(); + wxPyEndAllowThreads(tstate); #endif // Ensure that the build options in the DLL (or whatever) match this build @@ -439,10 +440,6 @@ PyObject* __wxStart(PyObject* /* self */, PyObject* args) goto error; } -#ifdef __WXGTK__ - wxTheApp->m_initialized = (wxTopLevelWindows.GetCount() > 0); -#endif - Py_DECREF(result); Py_DECREF(pyint); Py_INCREF(Py_None);