== BPython ==

[#8354] Blender or Python25.dll crash on... quit, reported by David B. (myvain)

The BPy_FreeButtonsList() function is also called after we call Py_Finalize(). Calling PyGILState_Ensure()/Release() there crashes Blender. Added a test to prevent this, but note that function still runs Python API code to free a buttons list. Doesn't seem to give problems, though. Thanks, David.
This commit is contained in:
2008-02-25 01:35:50 +00:00
parent ed7156a258
commit 18df3388a4

View File

@@ -881,13 +881,16 @@ void BPy_Free_DrawButtonsList(void)
{
/*Clear the list.*/
if (M_Button_List) {
PyGILState_STATE gilstate = PyGILState_Ensure();
PyGILState_STATE gilstate;
int py_is_on = Py_IsInitialized();
if (py_is_on) gilstate = PyGILState_Ensure();
PyList_SetSlice(M_Button_List, 0, PyList_Size(M_Button_List), NULL);
Py_DECREF(M_Button_List);
M_Button_List = NULL;
PyGILState_Release(gilstate);
if (py_is_on) PyGILState_Release(gilstate);
}
}