>       PyThreadState* tcur = PyThreadState_Get() ;
> 
>       PyThreadState_Swap(NULL);
>       PyThreadState_Clear(tcur);
>       PyThreadState_Delete(tcur);
> 
>       // release the GIL as PyEval_InitThreads
>       // implicitly acquires the GIL
>       PyEval_ReleaseLock();
> 
>       PyGILState_STATE gstate;

It's not necessary to do both the PyThreadState stuff *and* the PyGILState
stuff - just remove all the lines I quoted, except for the last, from both
callbacks and things should improve.

Cheers,

Mark

_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to