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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-06-09 15:19:34 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-06-09 15:19:34 +0400
commit21f5a87999bbc3f022a62812ae1ec1a30fa98135 (patch)
treeb5ba520874a6a31a6cdb666a58af39b9c4f2f28d /source
parent75dcc2a7dd1b4108cc724d1fd39761c4685d5186 (diff)
fix for memory leak re-binding meshes.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/object/object_modifier.c10
-rw-r--r--source/blender/modifiers/intern/MOD_meshdeform.c2
2 files changed, 10 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;
diff --git a/source/blender/modifiers/intern/MOD_meshdeform.c b/source/blender/modifiers/intern/MOD_meshdeform.c
index ba73f3fa0d1..5021f3a6d2e 100644
--- a/source/blender/modifiers/intern/MOD_meshdeform.c
+++ b/source/blender/modifiers/intern/MOD_meshdeform.c
@@ -72,6 +72,8 @@ static void freeData(ModifierData *md)
if(mmd->dyngrid) MEM_freeN(mmd->dyngrid);
if(mmd->dyninfluences) MEM_freeN(mmd->dyninfluences);
if(mmd->dynverts) MEM_freeN(mmd->dynverts);
+ if(mmd->bindweights) MEM_freeN(mmd->bindweights); /* deprecated */
+ if(mmd->bindcos) MEM_freeN(mmd->bindcos); /* deprecated */
}
static void copyData(ModifierData *md, ModifierData *target)