diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-07-26 00:51:45 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-07-26 00:51:45 +0400 |
commit | 1c00eacca2b084d7189de33cb75e8612cb542030 (patch) | |
tree | 8a1adf1ac6bc344f5a5b39988a4558028465b3f6 /source | |
parent | 88097e99099b8bea9c9e435d7c728afaa8bc24ff (diff) |
fix memleak in BGE py api - action.channelNames
Diffstat (limited to 'source')
-rw-r--r-- | source/gameengine/Converter/BL_ActionActuator.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp index 2df33f6ed4d..88d6d294dc0 100644 --- a/source/gameengine/Converter/BL_ActionActuator.cpp +++ b/source/gameengine/Converter/BL_ActionActuator.cpp @@ -1106,13 +1106,16 @@ PyObject* BL_ActionActuator::pyattr_get_channel_names(void *self_v, const KX_PYA { BL_ActionActuator* self= static_cast<BL_ActionActuator*>(self_v); PyObject *ret= PyList_New(0); + PyObject *item; bPose *pose= ((BL_ArmatureObject*)self->GetParent())->GetOrigPose(); if(pose) { bPoseChannel *pchan; for(pchan= (bPoseChannel *)pose->chanbase.first; pchan; pchan= (bPoseChannel *)pchan->next) { - PyList_Append(ret, PyString_FromString(pchan->name)); + item= PyString_FromString(pchan->name); + PyList_Append(ret, item); + Py_DECREF(item); } } |