X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/450c7f34c0a49a5b0c762157ab74f9073e87737a..569ef72a4d64a01a995053670c1f2abf3f6fd601:/wxPython/src/helpers.cpp diff --git a/wxPython/src/helpers.cpp b/wxPython/src/helpers.cpp index 69e70b5106..5744f06584 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(); @@ -1893,7 +1902,7 @@ wxString* wxString_in_helper(PyObject* source) { size_t len = PyUnicode_GET_SIZE(uni); if (len) { PyUnicode_AsWideChar((PyUnicodeObject*)uni, target->GetWriteBuf(len), len); - target->UngetWriteBuf(); + target->UngetWriteBuf(len); } if (PyString_Check(source))