[Bf-blender-cvs] [c174f1c8885] soc-2017-normal-tools: Fixed potential memory leak in modifier

Rohan Rathi noreply at git.blender.org
Fri Aug 4 18:44:50 CEST 2017


Commit: c174f1c888584a09d70bc75620db2a1517a6144b
Author: Rohan Rathi
Date:   Fri Aug 4 21:42:59 2017 +0530
Branches: soc-2017-normal-tools
https://developer.blender.org/rBc174f1c888584a09d70bc75620db2a1517a6144b

Fixed potential memory leak in modifier

===================================================================

M	source/blender/modifiers/intern/MOD_weighted_normal.c

===================================================================

diff --git a/source/blender/modifiers/intern/MOD_weighted_normal.c b/source/blender/modifiers/intern/MOD_weighted_normal.c
index 733214b5ae0..ca736cd2025 100644
--- a/source/blender/modifiers/intern/MOD_weighted_normal.c
+++ b/source/blender/modifiers/intern/MOD_weighted_normal.c
@@ -267,7 +267,6 @@ static void apply_weights_vertex_normal(WeightedNormalModifierData *wnmd, Object
 					}
 				}
 			}
-			MEM_freeN(sharp_verts);
 			for (int i = 0; i < numSharpVerts; i++) {
 				int *loops = loops_of_vert[i];
 				int totloop = loops_per_vert[*loops];
@@ -359,6 +358,7 @@ static void apply_weights_vertex_normal(WeightedNormalModifierData *wnmd, Object
 		}
 		BKE_mesh_normals_loop_custom_set(mvert, numVerts, medge, numEdges,
 			mloop, loop_normal, numLoops, mpoly, polynors, numPoly, clnors);
+		MEM_freeN(sharp_verts);
 		MEM_freeN(loops_to_poly);
 		MEM_freeN(loop_normal);
 		MEM_freeN(loops_per_vert);




More information about the Bf-blender-cvs mailing list