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>2007-05-26 08:39:31 +0400
committerCampbell Barton <ideasman42@gmail.com>2007-05-26 08:39:31 +0400
commit30dd4fafd13e84ed7363c0c0f6ab17a384098450 (patch)
treede0b558fe48f4a25be9d328c9b645a9795d458e4 /source/blender/python/api2_2x/Effect.c
parentea9b3dc387f5a167cf6b9e53f7be63e9b76de241 (diff)
More memory leaks fixed - in IDProp, Bone.head, tail, matrix, ob.DupObjects (my fault) and in Effect module as well as a few others.
Also stopped using Py_BuildValue for strings, ints and floats.
Diffstat (limited to 'source/blender/python/api2_2x/Effect.c')
-rw-r--r--source/blender/python/api2_2x/Effect.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/python/api2_2x/Effect.c b/source/blender/python/api2_2x/Effect.c
index 156c3bb26a6..1c309ba0851 100644
--- a/source/blender/python/api2_2x/Effect.c
+++ b/source/blender/python/api2_2x/Effect.c
@@ -1494,7 +1494,7 @@ static PyObject *Effect_getParticlesLoc( BPy_Effect * self )
Effect *eff;
PartEff *paf;
Particle *pa=0;
- PyObject *list, *strand_list, *pyvec;
+ PyObject *list, *strand_list, *pyvec, *pyvec2;
float p_time, c_time, vec[3], vec1[3], cfra, m_time, s_time;
int a;
short disp=100 ;
@@ -1585,13 +1585,17 @@ static PyObject *Effect_getParticlesLoc( BPy_Effect * self )
}
where_is_particle(paf, pa, s_time, vec);
where_is_particle(paf, pa, p_time, vec1);
- if( PyList_Append( list, Py_BuildValue("[OO]",
- newVectorObject(vec, 3, Py_NEW),
- newVectorObject(vec1, 3, Py_NEW))) < 0 ) {
+ pyvec = newVectorObject(vec, 3, Py_NEW);
+ pyvec2 = newVectorObject(vec1, 3, Py_NEW);
+ if( PyList_Append( list, Py_BuildValue("[OO]", pyvec, pyvec2)) < 0 ) {
Py_DECREF( list );
+ Py_XDECREF( pyvec );
+ Py_XDECREF( pyvec2 );
return EXPP_ReturnPyObjError( PyExc_RuntimeError,
"Couldn't append item to PyList" );
}
+ Py_DECREF( pyvec );
+ Py_DECREF( pyvec2 );
} else { /* not a vector */
where_is_particle(paf, pa, c_time, vec);
pyvec = newVectorObject(vec, 3, Py_NEW);