diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2014-01-26 19:53:33 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2014-01-26 19:56:50 +0400 |
commit | afb9393ddad3c57e99a5df13a74969c192a023f5 (patch) | |
tree | b5a835cc3f69cb96d11d64f6ecb5c39e5d01e1a1 /source/blender/makesrna/intern/rna_object_api.c | |
parent | 12109dd18e622a5c469c4fb5b802edfee0d2b2de (diff) |
Fix T38354: Excess memory allocation when projecting onto object with multires
Found three cases where created bvhtree was not freed...
Diffstat (limited to 'source/blender/makesrna/intern/rna_object_api.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_object_api.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index fc97a32f3a7..b4692f9aec3 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -309,6 +309,7 @@ static void rna_Object_ray_cast(Object *ob, ReportList *reports, float ray_start copy_v3_v3(r_location, hit.co); copy_v3_v3(r_normal, hit.no); *index = dm_tessface_to_poly_index(ob->derivedFinal, hit.index); + free_bvhtree_from_mesh(&treeData); return; } } @@ -317,6 +318,7 @@ static void rna_Object_ray_cast(Object *ob, ReportList *reports, float ray_start zero_v3(r_location); zero_v3(r_normal); *index = -1; + free_bvhtree_from_mesh(&treeData); } static void rna_Object_closest_point_on_mesh(Object *ob, ReportList *reports, float point_co[3], float max_dist, @@ -348,6 +350,7 @@ static void rna_Object_closest_point_on_mesh(Object *ob, ReportList *reports, fl copy_v3_v3(n_location, nearest.co); copy_v3_v3(n_normal, nearest.no); *index = dm_tessface_to_poly_index(ob->derivedFinal, nearest.index); + free_bvhtree_from_mesh(&treeData); return; } } @@ -355,6 +358,7 @@ static void rna_Object_closest_point_on_mesh(Object *ob, ReportList *reports, fl zero_v3(n_location); zero_v3(n_normal); *index = -1; + free_bvhtree_from_mesh(&treeData); } /* ObjectBase */ |