fix for crash when a python operator or render engine was freed in the C code and then referenced from python.
now further access in python gives an exception at the line when the freed data is accessed.
This commit is contained in:
@@ -510,6 +510,18 @@ void BPY_DECREF(void *pyob_ptr)
|
||||
PyGILState_Release(gilstate);
|
||||
}
|
||||
|
||||
void BPY_RNA_DECREF_INVALIDATE(void *pyob_ptr)
|
||||
{
|
||||
PyGILState_STATE gilstate = PyGILState_Ensure();
|
||||
const int do_invalidate = (Py_REFCNT((PyObject *)pyob_ptr) > 1);
|
||||
Py_DECREF((PyObject *)pyob_ptr);
|
||||
if (do_invalidate) {
|
||||
pyrna_invalidate(pyob_ptr);
|
||||
}
|
||||
PyGILState_Release(gilstate);
|
||||
}
|
||||
|
||||
|
||||
/* return -1 on error, else 0 */
|
||||
int BPY_button_exec(bContext *C, const char *expr, double *value, const short verbose)
|
||||
{
|
||||
|
Reference in New Issue
Block a user