Fix memory leak with Python RNA property get callback errors

Failure to return a list of the expected size & type wasn't
decrementing the value, leaking a reference.

Caused by 127b5423d6 a workaround for the
real error that was fixed f5e020a7a6.
This commit is contained in:
Campbell Barton 2021-07-28 01:07:14 +10:00
parent 766e67e55d
commit d6d44faff0
Notes: blender-bot 2024-01-31 11:35:08 +01:00
Referenced by issue #88449, Blender LTS: Maintenance Task 2.93
Referenced by issue #77348, Blender LTS: Maintenance Task 2.83
1 changed files with 3 additions and 15 deletions

View File

@ -726,12 +726,8 @@ static void bpy_prop_boolean_array_get_fn(struct PointerRNA *ptr,
for (i = 0; i < len; i++) {
values[i] = false;
}
/* PyC_AsArray decrements refcount internally on error */
}
else {
Py_DECREF(ret);
}
Py_DECREF(ret);
}
if (use_gil) {
@ -977,12 +973,8 @@ static void bpy_prop_int_array_get_fn(struct PointerRNA *ptr,
for (i = 0; i < len; i++) {
values[i] = 0;
}
/* PyC_AsArray decrements refcount internally on error */
}
else {
Py_DECREF(ret);
}
Py_DECREF(ret);
}
if (use_gil) {
@ -1228,12 +1220,8 @@ static void bpy_prop_float_array_get_fn(struct PointerRNA *ptr,
for (i = 0; i < len; i++) {
values[i] = 0.0f;
}
/* PyC_AsArray decrements refcount internally on error */
}
else {
Py_DECREF(ret);
}
Py_DECREF(ret);
}
if (use_gil) {