Vertex Weight Proximity: fixing bug #28560 (memory leak).
authorBastien Montagne <montagne29@wanadoo.fr>
Wed, 7 Sep 2011 20:06:04 +0000 (20:06 +0000)
committerBastien Montagne <montagne29@wanadoo.fr>
Wed, 7 Sep 2011 20:06:04 +0000 (20:06 +0000)
source/blender/modifiers/intern/MOD_weightvgproximity.c

index ffb783f8adc9f265c25611b0629ac631c31f1fc4..561a021ce0cc5fdf8be086a442952c11bb5c0491 100644 (file)
@@ -481,6 +481,9 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, DerivedMesh *der
                                        new_w[i] = dists_e ? minf(dists_e[i], new_w[i]) : new_w[i];
                                        new_w[i] = dists_f ? minf(dists_f[i], new_w[i]) : new_w[i];
                                }
+                               if(dists_v) MEM_freeN(dists_v);
+                               if(dists_e) MEM_freeN(dists_e);
+                               if(dists_f) MEM_freeN(dists_f);
                        }
                        /* Else, fall back to default obj2vert behavior. */
                        else {