From: Robin Dunn Date: Thu, 26 Aug 2004 17:07:46 +0000 (+0000) Subject: Only initialize wxWidgets once X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/6f845b22151aa252447d4805bdbfefe2ef66f3e2?ds=sidebyside Only initialize wxWidgets once git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28928 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/src/helpers.cpp b/wxPython/src/helpers.cpp index 69e70b5106..e85e1fac53 100644 --- a/wxPython/src/helpers.cpp +++ b/wxPython/src/helpers.cpp @@ -378,58 +378,67 @@ void wxPyApp::SetMacHelpMenuTitleName(const wxString& val) { // that should be present in the derived (Python) class. void wxPyApp::_BootstrapApp() { - bool result; + static bool haveInitialized = false; + bool result, blocked; PyObject* retval = NULL; PyObject* pyint = NULL; - - // Get any command-line args passed to this program from the sys module - int argc = 0; - char** argv = NULL; - bool blocked = wxPyBeginBlockThreads(); - PyObject* sysargv = PySys_GetObject("argv"); - if (sysargv != NULL) { - argc = PyList_Size(sysargv); - argv = new char*[argc+1]; - int x; - for(x=0; xSetStartupComplete(True); // Call the Python wxApp's OnInit function + blocked = wxPyBeginBlockThreads(); if (wxPyCBH_findCallback(m_myInst, "OnInit")) { PyObject* method = m_myInst.GetLastFound();