git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8985 
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
 }
 
 
-HELPEREXPORT bool wxPyRestoreThread() {
+bool wxPyRestoreThread() {
     // NOTE: The Python API docs state that if a thread already has the
     // interpreter lock and calls PyEval_RestoreThread again a deadlock
     // occurs, so I put in this code as a guard condition since there are
 }
 
 
-HELPEREXPORT void wxPySaveThread(bool doSave) {
+void wxPySaveThread(bool doSave) {
 #ifdef WXP_WITH_THREAD
     if (doSave) {
         wxPyEventThreadState = PyEval_SaveThread();
 
         bool doSave;
 #ifdef wxPyUSE_EXPORT
         doSave = wxPyCoreAPIPtr->p_wxPyRestoreThread();
-#else
-        doSave = wxPyRestoreThread();
-#endif
-
         Py_DECREF(m_obj);
-
-#ifdef wxPyUSE_EXPORT
         wxPyCoreAPIPtr->p_wxPySaveThread(doSave);
 #else
+        doSave = wxPyRestoreThread();
+        Py_DECREF(m_obj);
         wxPySaveThread(doSave);
 #endif
     }