Commit: 41169c3cf1f2a5295f374ca111182cc52fd1d161
Author: Lukas Tönne
Date:   Fri Nov 28 14:15:14 2014 +0100
Branches: hair_immediate_fixes
https://developer.blender.org/rB41169c3cf1f2a5295f374ca111182cc52fd1d161

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 8500dee..1ce0c5c 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -567,8 +567,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