Fix memory leaks in Python gizmo get/set handlers

This commit is contained in:
Campbell Barton 2021-07-29 14:31:03 +10:00
parent 3c50687073
commit d5fd09ab58
Notes: blender-bot 2023-02-14 01:07:44 +01:00
Referenced by issue #88449, Blender LTS: Maintenance Task 2.93
1 changed files with 5 additions and 2 deletions

View File

@ -103,6 +103,8 @@ fail:
PyErr_Print();
PyErr_Clear();
Py_DECREF(ret);
PyGILState_Release(gilstate);
}
@ -139,6 +141,7 @@ static void py_rna_gizmo_handler_set_cb(const wmGizmo *UNUSED(gz),
if (ret == NULL) {
goto fail;
}
Py_DECREF(args);
Py_DECREF(ret);
PyGILState_Release(gilstate);
@ -199,11 +202,11 @@ static void py_rna_gizmo_handler_range_get_cb(const wmGizmo *UNUSED(gz),
return;
fail:
Py_XDECREF(ret);
PyErr_Print();
PyErr_Clear();
Py_XDECREF(ret);
PyGILState_Release(gilstate);
}