Commit: 2d79994e39d64120852a895b828e171500d3afe4
Author: Lukas Tönne
Date:   Fri Nov 28 14:15:14 2014 +0100
Branches: strand_editmode
https://developer.blender.org/rB2d79994e39d64120852a895b828e171500d3afe4

Free strand edit memory after use.

===================================================================

M       source/blender/blenkernel/intern/particle.c
M       source/blender/editors/hair/hair_edit.c

===================================================================

diff --git a/source/blender/blenkernel/intern/particle.c 
b/source/blender/blenkernel/intern/particle.c
index c02cf95..2243a91 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -547,8 +547,11 @@ void psys_free(Object *ob, ParticleSystem *psys)
 
                if (psys->edit && psys->free_edit)
                        psys->free_edit(psys->edit);
-               if (psys->hairedit)
+               if (psys->hairedit) {
                        BKE_editstrands_free(psys->hairedit);
+                       MEM_freeN(psys->hairedit);
+                       psys->hairedit = NULL;
+               }
 
                if (psys->child) {
                        MEM_freeN(psys->child);
diff --git a/source/blender/editors/hair/hair_edit.c 
b/source/blender/editors/hair/hair_edit.c
index e52aaca..611259b 100644
--- a/source/blender/editors/hair/hair_edit.c
+++ b/source/blender/editors/hair/hair_edit.c
@@ -31,6 +31,8 @@
 
 #include <stdlib.h>
 
+#include "MEM_guardedalloc.h"
+
 #include "BLI_utildefines.h"
 
 #include "DNA_object_types.h"
@@ -84,6 +86,7 @@ static bool apply_hair_edit(Object *ob)
                        psys->flag |= PSYS_EDITED;
                        
                        BKE_editstrands_free(psys->hairedit);
+                       MEM_freeN(psys->hairedit);
                        psys->hairedit = NULL;
                }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to