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 by127b5423d6
a workaround for the real error that was fixedf5e020a7a6
.
This commit is contained in:
parent
66c65da688
commit
1f96166e08
Notes:
blender-bot
2023-02-14 07:39:46 +01:00
Referenced by issue #77348, Blender LTS: Maintenance Task 2.83
|
@ -494,12 +494,8 @@ static void bpy_prop_boolean_array_get_cb(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) {
|
||||
|
@ -738,12 +734,8 @@ static void bpy_prop_int_array_get_cb(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) {
|
||||
|
@ -982,12 +974,8 @@ static void bpy_prop_float_array_get_cb(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) {
|
||||
|
|
Loading…
Reference in New Issue