diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-06-09 15:19:34 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-06-09 15:19:34 +0400 |
commit | 21f5a87999bbc3f022a62812ae1ec1a30fa98135 (patch) | |
tree | b5ba520874a6a31a6cdb666a58af39b9c4f2f28d /source/blender/editors/object/object_modifier.c | |
parent | 75dcc2a7dd1b4108cc724d1fd39761c4685d5186 (diff) |
fix for memory leak re-binding meshes.
Diffstat (limited to 'source/blender/editors/object/object_modifier.c')
-rw-r--r-- | source/blender/editors/object/object_modifier.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 5996037cd2d..32844e6af5d 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -1259,16 +1259,22 @@ static int meshdeform_bind_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; if(mmd->bindcagecos) { - if(mmd->bindweights) MEM_freeN(mmd->bindweights); if(mmd->bindcagecos) MEM_freeN(mmd->bindcagecos); if(mmd->dyngrid) MEM_freeN(mmd->dyngrid); if(mmd->dyninfluences) MEM_freeN(mmd->dyninfluences); + if(mmd->bindinfluences) MEM_freeN(mmd->bindinfluences); + if(mmd->bindoffsets) MEM_freeN(mmd->bindoffsets); if(mmd->dynverts) MEM_freeN(mmd->dynverts); - mmd->bindweights= NULL; + if(mmd->bindweights) MEM_freeN(mmd->bindweights); /* deprecated */ + if(mmd->bindcos) MEM_freeN(mmd->bindcos); /* deprecated */ + mmd->bindcagecos= NULL; mmd->dyngrid= NULL; mmd->dyninfluences= NULL; + mmd->bindoffsets= NULL; mmd->dynverts= NULL; + mmd->bindweights= NULL; /* deprecated */ + mmd->bindcos= NULL; /* deprecated */ mmd->totvert= 0; mmd->totcagevert= 0; mmd->totinfluence= 0; |