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 <ideasman42@gmail.com>2009-01-01 19:18:54 +0300
committerCampbell Barton <ideasman42@gmail.com>2009-01-01 19:18:54 +0300
commitabd4934d1aeceafaa2fc242f00db0ba53a7e24db (patch)
tree2bd0a192f5c49cd6f1bea5988fdd039b9834dada
parent2dfd34994fb2a5d7d8ca57a7ce1fa18e7047463e (diff)
fix for a memory leak in NMesh (deprecated api) while looking at bug report...
[#18139] Memory Leaks while using Py_BuildValue
-rw-r--r--source/blender/python/api2_2x/NMesh.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/python/api2_2x/NMesh.c b/source/blender/python/api2_2x/NMesh.c
index 2e82c55155f..22f619c5f31 100644
--- a/source/blender/python/api2_2x/NMesh.c
+++ b/source/blender/python/api2_2x/NMesh.c
@@ -1476,7 +1476,7 @@ static PyObject *NMesh_update( PyObject *self, PyObject *a, PyObject *kwd )
static PyObject *NMesh_getVertexInfluences( PyObject * self, PyObject * args )
{
int index;
- PyObject *influence_list = NULL;
+ PyObject *influence_list = NULL, *item;
Object *object = ( ( BPy_NMesh * ) self )->object;
Mesh *me = ( ( BPy_NMesh * ) self )->mesh;
@@ -1516,9 +1516,11 @@ static PyObject *NMesh_getVertexInfluences( PyObject * self, PyObject * args )
for( i = 0; i < totinfluences; i++, sweight++ ) {
bDeformGroup *defgroup = (bDeformGroup *) BLI_findlink( &object->defbase,
sweight->def_nr );
- if( defgroup )
- PyList_Append( influence_list, Py_BuildValue( "[sf]",
- defgroup->name, sweight->weight ) );
+ if( defgroup ) {
+ item = Py_BuildValue( "[sf]", defgroup->name, sweight->weight );
+ PyList_Append( influence_list, item);
+ Py_DECREF(item);
+ }
}
}