diff options
author | Bastien Montagne <bastien@blender.org> | 2020-09-24 21:52:04 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-09-24 22:08:27 +0300 |
commit | 771d041c4cb3922617484d69f3b3c83c635bcace (patch) | |
tree | c568905228292f6018267b0f91a91a644fde33c3 /source | |
parent | 744f81c936cbd946d2eb8035b9714b5f6bfbdc8c (diff) |
Fix (unreported) memory leak in Extrude mode of the Solidify modifier.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/modifiers/intern/MOD_solidify_extrude.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/source/blender/modifiers/intern/MOD_solidify_extrude.c b/source/blender/modifiers/intern/MOD_solidify_extrude.c index 818327e120b..b97ee434597 100644 --- a/source/blender/modifiers/intern/MOD_solidify_extrude.c +++ b/source/blender/modifiers/intern/MOD_solidify_extrude.c @@ -1004,23 +1004,23 @@ Mesh *MOD_solidify_extrude_modifyMesh(ModifierData *md, const ModifierEvalContex &result->vdata, CD_MDEFORMVERT, CD_CALLOC, NULL, result->totvert); } /* Ultimate security check. */ - if (!dvert) { - return result; - } - result->dvert = dvert; - - if (rim_defgrp_index != -1) { - for (uint i = 0; i < rimVerts; i++) { - BKE_defvert_ensure_index(&result->dvert[new_vert_arr[i]], rim_defgrp_index)->weight = 1.0f; - BKE_defvert_ensure_index(&result->dvert[(do_shell ? new_vert_arr[i] : i) + numVerts], - rim_defgrp_index) - ->weight = 1.0f; + if (dvert != NULL) { + result->dvert = dvert; + + if (rim_defgrp_index != -1) { + for (uint i = 0; i < rimVerts; i++) { + BKE_defvert_ensure_index(&result->dvert[new_vert_arr[i]], rim_defgrp_index)->weight = + 1.0f; + BKE_defvert_ensure_index(&result->dvert[(do_shell ? new_vert_arr[i] : i) + numVerts], + rim_defgrp_index) + ->weight = 1.0f; + } } - } - if (shell_defgrp_index != -1) { - for (uint i = numVerts; i < result->totvert; i++) { - BKE_defvert_ensure_index(&result->dvert[i], shell_defgrp_index)->weight = 1.0f; + if (shell_defgrp_index != -1) { + for (uint i = numVerts; i < result->totvert; i++) { + BKE_defvert_ensure_index(&result->dvert[i], shell_defgrp_index)->weight = 1.0f; + } } } } |