[Bf-blender-cvs] [20f04ce62af] blender-v2.93-release: Fix memory leak with building springs in the cloth simulator

Campbell Barton noreply at git.blender.org
Mon Aug 23 09:35:45 CEST 2021


Commit: 20f04ce62af160f0c9a3ff0b6c8c69461382bbfc
Author: Campbell Barton
Date:   Fri Aug 20 15:57:50 2021 +1000
Branches: blender-v2.93-release
https://developer.blender.org/rB20f04ce62af160f0c9a3ff0b6c8c69461382bbfc

Fix memory leak with building springs in the cloth simulator

Error in 2788b0261cb7d33a2f6f2978ff4f55bb4987edae.

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

M	source/blender/blenkernel/intern/cloth.c
M	source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c

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

diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c
index 09bd397cc78..4796ad24111 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -42,6 +42,7 @@
 #include "BKE_cloth.h"
 #include "BKE_effect.h"
 #include "BKE_global.h"
+#include "BKE_lib_id.h"
 #include "BKE_mesh.h"
 #include "BKE_mesh_runtime.h"
 #include "BKE_modifier.h"
@@ -1575,7 +1576,7 @@ static bool cloth_build_springs(ClothModifierData *clmd, Mesh *mesh)
           BLI_edgeset_free(existing_vert_pairs);
           free_bvhtree_from_mesh(&treedata);
           if (tmp_mesh) {
-            BKE_mesh_free(tmp_mesh);
+            BKE_id_free(NULL, &tmp_mesh->id);
           }
           return false;
         }
@@ -1584,7 +1585,7 @@ static bool cloth_build_springs(ClothModifierData *clmd, Mesh *mesh)
     BLI_edgeset_free(existing_vert_pairs);
     free_bvhtree_from_mesh(&treedata);
     if (tmp_mesh) {
-      BKE_mesh_free(tmp_mesh);
+      BKE_id_free(NULL, &tmp_mesh->id);
     }
     BLI_rng_free(rng);
   }
diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
index 805c864566a..becccf25572 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -1471,6 +1471,7 @@ static void lineart_geometry_object_load(Depsgraph *dg,
                                          int override_usage,
                                          int *global_vindex)
 {
+  printf("========================================================\nTESTING\n");
   BMesh *bm;
   BMVert *v;
   BMFace *f;



More information about the Bf-blender-cvs mailing list