diff options
author | Daniel Genrich <daniel.genrich@gmx.net> | 2008-04-22 02:02:15 +0400 |
---|---|---|
committer | Daniel Genrich <daniel.genrich@gmx.net> | 2008-04-22 02:02:15 +0400 |
commit | a1b1cfdc388db65c563da5d8da1c920e5ba02bd9 (patch) | |
tree | ba3b432389cb291036b2913d6a624355022d9f79 /source/blender/blenkernel/intern/modifier.c | |
parent | e2cac820f975775aa9f20a4c107b0c3575049d6a (diff) |
Cloth: Fix point cache memory leak when duplicating cloth
Diffstat (limited to 'source/blender/blenkernel/intern/modifier.c')
-rw-r--r-- | source/blender/blenkernel/intern/modifier.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index 8fc6a026005..0cd6035b9dc 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -5142,11 +5142,14 @@ static void clothModifier_copyData(ModifierData *md, ModifierData *target) if(tclmd->sim_parms) MEM_freeN(tclmd->sim_parms); if(tclmd->coll_parms) - MEM_freeN(tclmd->coll_parms); + MEM_freeN(tclmd->coll_parms); + if(tclmd->point_cache) + BKE_ptcache_free(tclmd->point_cache); tclmd->sim_parms = MEM_dupallocN(clmd->sim_parms); tclmd->coll_parms = MEM_dupallocN(clmd->coll_parms); tclmd->point_cache = BKE_ptcache_copy(clmd->point_cache); + tclmd->clothObject = NULL; } static int clothModifier_dependsOnTime(ModifierData *md) |