From 9e2cd6b07784e58f0e9b2ad6800f3ca8b54f9745 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 20 Aug 2021 15:57:50 +1000 Subject: Fix memory leak with building springs in the cloth simulator Error in 2788b0261cb7d33a2f6f2978ff4f55bb4987edae. --- source/blender/blenkernel/intern/cloth.c | 5 +++-- source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index 9aa2d017c48..080a7c90c46 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" @@ -1574,7 +1575,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_data(tmp_mesh); + BKE_id_free(NULL, &tmp_mesh->id); } return false; } @@ -1583,7 +1584,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_data(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 564a3c526f4..e6b1012c981 100644 --- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c +++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c @@ -1649,6 +1649,7 @@ static int lineart_edge_type_duplication_count(char eflag) } static void lineart_geometry_object_load(LineartObjectInfo *obi, LineartRenderBuffer *rb) { + printf("========================================================\nTESTING\n"); BMesh *bm; BMVert *v; BMFace *f; -- cgit v1.2.3