Fix memory leak in IDPropertyGroup.pop()

When popping ID-property groups/arrays,
ID-property was removed but not freed.

Now the value is converted to a native Python type and freed.
This commit is contained in:
2021-05-14 19:18:50 +10:00
parent fce795415a
commit 3c09beb3b1
4 changed files with 13 additions and 7 deletions

View File

@@ -766,7 +766,7 @@ static PyObject *BPy_IDGroup_iter(BPy_IDProperty *self)
}
/* for simple, non nested types this is the same as BPy_IDGroup_WrapData */
static PyObject *BPy_IDGroup_MapDataToPy(IDProperty *prop)
PyObject *BPy_IDGroup_MapDataToPy(IDProperty *prop)
{
switch (prop->type) {
case IDP_STRING:
@@ -919,7 +919,7 @@ static PyObject *BPy_IDGroup_pop(BPy_IDProperty *self, PyObject *args)
return NULL;
}
IDP_RemoveFromGroup(self->prop, idprop);
IDP_FreeFromGroup(self->prop, idprop);
return pyform;
}