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
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-03-15 07:03:27 +0300
committerCampbell Barton <campbell@blender.org>2022-03-15 07:03:27 +0300
commit977c958242cdfbdb8a0510789e34629301b34616 (patch)
tree12d069a0affb8bbdc0d28b08109fad46cd25c113
parent3cbf20228ee84b838cc777c8129a30eaa58c62d1 (diff)
Fix memory leak when there is an error evaluating a PyDriver
In practice users are unlikely to ever run into this error.
-rw-r--r--source/blender/python/intern/bpy_driver.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/python/intern/bpy_driver.c b/source/blender/python/intern/bpy_driver.c
index b7818e484e9..c88e42aa90f 100644
--- a/source/blender/python/intern/bpy_driver.c
+++ b/source/blender/python/intern/bpy_driver.c
@@ -575,7 +575,7 @@ float BPY_driver_exec(struct PathResolvedRNA *anim_rna,
/* try to add to dictionary */
/* if (PyDict_SetItemString(driver_vars, dvar->name, driver_arg)) { */
if (PyDict_SetItem(driver_vars, PyTuple_GET_ITEM(expr_vars, i++), driver_arg) != -1) {
- Py_DECREF(driver_arg);
+ /* Pass. */
}
else {
/* this target failed - bad name */
@@ -591,6 +591,7 @@ float BPY_driver_exec(struct PathResolvedRNA *anim_rna,
PyErr_Print();
PyErr_Clear();
}
+ Py_DECREF(driver_arg);
}
#ifdef USE_BYTECODE_WHITELIST