A fix for Python 2.2 which can sometimes call __wxCleanup before all

the other wxPython objects have been deleted.

Other various things to match recent CVS changes in wx.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14163 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2002-02-12 21:28:41 +00:00
parent a3215b22a3
commit be43cc441a
9 changed files with 123 additions and 17 deletions

View File

@@ -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++) {