Some cleanup and a fix

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8985 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn 2000-12-22 00:47:36 +00:00
parent 1e7ecb7be0
commit bdb9373a32
2 changed files with 4 additions and 8 deletions

View File

@ -309,7 +309,7 @@ static PyThreadState* myPyThreadState_Get() {
} }
HELPEREXPORT bool wxPyRestoreThread() { bool wxPyRestoreThread() {
// NOTE: The Python API docs state that if a thread already has the // NOTE: The Python API docs state that if a thread already has the
// interpreter lock and calls PyEval_RestoreThread again a deadlock // interpreter lock and calls PyEval_RestoreThread again a deadlock
// occurs, so I put in this code as a guard condition since there are // occurs, so I put in this code as a guard condition since there are
@ -328,7 +328,7 @@ HELPEREXPORT bool wxPyRestoreThread() {
} }
HELPEREXPORT void wxPySaveThread(bool doSave) { void wxPySaveThread(bool doSave) {
#ifdef WXP_WITH_THREAD #ifdef WXP_WITH_THREAD
if (doSave) { if (doSave) {
wxPyEventThreadState = PyEval_SaveThread(); wxPyEventThreadState = PyEval_SaveThread();

View File

@ -323,15 +323,11 @@ public:
bool doSave; bool doSave;
#ifdef wxPyUSE_EXPORT #ifdef wxPyUSE_EXPORT
doSave = wxPyCoreAPIPtr->p_wxPyRestoreThread(); doSave = wxPyCoreAPIPtr->p_wxPyRestoreThread();
#else
doSave = wxPyRestoreThread();
#endif
Py_DECREF(m_obj); Py_DECREF(m_obj);
#ifdef wxPyUSE_EXPORT
wxPyCoreAPIPtr->p_wxPySaveThread(doSave); wxPyCoreAPIPtr->p_wxPySaveThread(doSave);
#else #else
doSave = wxPyRestoreThread();
Py_DECREF(m_obj);
wxPySaveThread(doSave); wxPySaveThread(doSave);
#endif #endif
} }