X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7faa9591f499a5d10f7d3ef7b061c0fe5774c53f..c921c2cd3ada7fe34deaf48d70982c2cf5a963df:/wxPython/src/helpers.cpp diff --git a/wxPython/src/helpers.cpp b/wxPython/src/helpers.cpp index 13f93b78c3..340c740037 100644 --- a/wxPython/src/helpers.cpp +++ b/wxPython/src/helpers.cpp @@ -256,8 +256,8 @@ PyObject* __wxSetDictionary(PyObject* /* self */, PyObject* args) #ifdef __WXMOTIF__ #define wxPlatform "__WXMOTIF__" #endif -#ifdef __WXQT__ -#define wxPlatform "__WXQT__" +#ifdef __WXX11__ +#define wxPlatform "__WXX11__" #endif #ifdef __WXGTK__ #define wxPlatform "__WXGTK__" @@ -450,9 +450,12 @@ unsigned long wxPyGetCurrentThreadId() { return wxThread::GetCurrentId(); } - +static PyThreadState* gs_shutdownTState; static PyThreadState* wxPyGetThreadState() { + if (wxPyTMutex == NULL) // Python is shutting down... + return gs_shutdownTState; + unsigned long ctid = wxPyGetCurrentThreadId(); PyThreadState* tstate = NULL; @@ -471,6 +474,10 @@ PyThreadState* wxPyGetThreadState() { static void wxPySaveThreadState(PyThreadState* tstate) { + if (wxPyTMutex == NULL) { // Python is shutting down, assume a single thread... + gs_shutdownTState = tstate; + return; + } unsigned long ctid = wxPyGetCurrentThreadId(); wxPyTMutex->Lock(); for(size_t i=0; i < wxPyTStates->GetCount(); i++) {