wxPyApp::~wxPyApp() {
+ wxPythonApp = NULL;
+ wxApp::SetInstance(NULL);
}
if (sysargv != NULL && executable != NULL) {
argc = PyList_Size(sysargv) + 1;
argv = new char*[argc+1];
- argv[0] = PyString_AsString(executable);
+ argv[0] = strdup(PyString_AsString(executable));
int x;
for(x=1; x<argc; x++) {
PyObject *pyArg = PyList_GetItem(sysargv, x-1);
- argv[x] = PyString_AsString(pyArg);
+ argv[x] = strdup(PyString_AsString(pyArg));
}
argv[argc] = NULL;
}
// Initialize wxWidgets
result = wxEntryStart(argc, argv);
- delete [] argv;
+ // wxApp takes ownership of the argv array, don't delete it here
blocked = wxPyBeginBlockThreads();
if (! result) {
setlocale(LC_NUMERIC, "C");
#endif
- wxSystemOptions::SetOptionInt(wxT("mac.textcontrol-use-mlte"), 1);
+ wxSystemOptions::SetOption(wxT("mac.textcontrol-use-mlte"), 1);
// The stock objects were all NULL when they were loaded into
// SWIG generated proxies, so re-init those now...