diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-07-29 07:31:03 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-07-29 07:32:25 +0300 |
commit | d5fd09ab58874a971d21d49eedb46b735e4180f0 (patch) | |
tree | 3a69e24c87d7d0be6ee12d087120c18448f49292 /source/blender/python/intern/bpy_rna_gizmo.c | |
parent | 3c5068707344c15c876e726f90254e22ec4e1903 (diff) |
Fix memory leaks in Python gizmo get/set handlers
Diffstat (limited to 'source/blender/python/intern/bpy_rna_gizmo.c')
-rw-r--r-- | source/blender/python/intern/bpy_rna_gizmo.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/python/intern/bpy_rna_gizmo.c b/source/blender/python/intern/bpy_rna_gizmo.c index 768cc927d5c..f121bfd6e36 100644 --- a/source/blender/python/intern/bpy_rna_gizmo.c +++ b/source/blender/python/intern/bpy_rna_gizmo.c @@ -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); } |