Problems with PyGILState_Ensure () and PyGILState_Release ()
Domoran at yahoo.de
Fri Aug 13 13:49:09 CEST 2004
i am writing a python extension in c++. In the extension a c++ thread
calls back into python. I did it like this:
---- c++ code ----
gstate = PyGILState_Ensure ();
... do some work ...
// call the python callback (Func)
result = PyEval_CallObject(Func, arglist);
... so some cleanup ...
the callback is executed properly, but the PyGILState_Release gives me the
"Fatal Python error: PyThreadState_Delete: tstate is still current"
What can be wrong here? Any suggestions?
In my understanding this error should not occur ... Is this a known bug
maybe? I am using Python 2.4a1 under windows.
Thanks in advance, Mathias Mamsch
More information about the Python-list