diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2018-08-31 22:23:38 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2018-08-31 22:25:37 +0300 |
commit | 0610c09f8c0e8188abdf377d8b6fd36be012ed0a (patch) | |
tree | 28ac18d879a14fa58dfde79fe5cf6a51452e4d9e /source | |
parent | b0c146a9eba941befb9eb60b079f4ac80bfbe6b2 (diff) |
Fix memleak on snap_curs_to_sel_ex
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_snap.c | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c index 84474136396..484eb38297b 100644 --- a/source/blender/editors/space_view3d/view3d_snap.c +++ b/source/blender/editors/space_view3d/view3d_snap.c @@ -621,21 +621,21 @@ static bool snap_curs_to_sel_ex(bContext *C, float cursor[3]) } global_transverts_tot += tvs.transverts_tot; - if (global_transverts_tot == 0) { - continue; - } + if (global_transverts_tot != 0) { - Object *obedit_eval = DEG_get_evaluated_object(depsgraph, obedit); - copy_m3_m4(bmat, obedit_eval->obmat); + Object *obedit_eval = DEG_get_evaluated_object(depsgraph, obedit); + copy_m3_m4(bmat, obedit_eval->obmat); - tv = tvs.transverts; - for (a = 0; a < tvs.transverts_tot; a++, tv++) { - copy_v3_v3(vec, tv->loc); - mul_m3_v3(bmat, vec); - add_v3_v3(vec, obedit_eval->obmat[3]); - add_v3_v3(centroid, vec); - minmax_v3v3_v3(min, max, vec); + tv = tvs.transverts; + for (a = 0; a < tvs.transverts_tot; a++, tv++) { + copy_v3_v3(vec, tv->loc); + mul_m3_v3(bmat, vec); + add_v3_v3(vec, obedit_eval->obmat[3]); + add_v3_v3(centroid, vec); + minmax_v3v3_v3(min, max, vec); + } } + ED_transverts_free(&tvs); } MEM_freeN(objects); @@ -646,8 +646,6 @@ static bool snap_curs_to_sel_ex(bContext *C, float cursor[3]) else { mid_v3_v3v3(cursor, min, max); } - - ED_transverts_free(&tvs); } else { Object *obact = CTX_data_active_object(C); |