Fix (unreported) potentially giant memory leak in Cloth collision solver.
authorBastien Montagne <montagne29@wanadoo.fr>
Mon, 3 Sep 2018 13:30:33 +0000 (15:30 +0200)
committerBastien Montagne <montagne29@wanadoo.fr>
Mon, 3 Sep 2018 13:30:33 +0000 (15:30 +0200)
Not freeing its BVHTree in case there were no collision objects,
could quickly lead to hundreds of MB of memleak!

source/blender/blenkernel/intern/collision.c

index b38d6b8bcebedd4091f2e12ae6c020de1d8e79a4..65c84187307283f59b085518c2bc2cb4107bba9d 100644 (file)
@@ -1357,6 +1357,7 @@ void cloth_find_point_contacts(Object *ob, ClothModifierData *clmd, float step,
        if (!collobjs) {
                *r_collider_contacts = NULL;
                *r_totcolliders = 0;
+               BLI_bvhtree_free(cloth_bvh);
                return;
        }