Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-07-29 07:31:03 +0300
committerJeroen Bakker <jeroen@blender.org>2021-08-09 09:11:00 +0300
commit2be2aeaf0a515edc75e8c744a82cf8a921a6ab38 (patch)
tree91480d0472fddc67fc4d1781d435719b9c5105d1 /source
parentdb5501eb6edd3034f4653d1c687f8b76d5449ab5 (diff)
Fix memory leaks in Python gizmo get/set handlers
Diffstat (limited to 'source')
-rw-r--r--source/blender/python/intern/bpy_rna_gizmo.c7
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 1f27e4bcca8..ade9516d768 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);
}