Need to acquire the Python GIL also in ~PythonEventImpl, as it may be called at any time from the C++ code, from any thread.

This commit is contained in:
Gustavo J. A. M. Carneiro committed 2008-09-27 15:32:04 +01:00
1 parent 607487607a
commit eab3243523
1 file changed
+6
+6
View File
@@ -28,8 +28,14 @@ public:
}
virtual ~PythonEventImpl ()
{
PyGILState_STATE __py_gil_state;
__py_gil_state = (PyEval_ThreadsInitialized() ? PyGILState_Ensure() : (PyGILState_STATE) 0);
Py_DECREF(m_callback);
Py_DECREF(m_args);
if (PyEval_ThreadsInitialized())
PyGILState_Release(__py_gil_state);
}
virtual void Notify ()
{