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
2008-09-27 15:32:04 +01:00
parent 8e454b058b
commit d607ae00f3

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 ()
{