From c0d18491b6493c55c7239eaee0ae84eea1581667 Mon Sep 17 00:00:00 2001 From: Tamito Kajiyama Date: Thu, 3 Jun 2010 15:04:55 +0000 Subject: Fix for a memory leak in WingedEdgeBuilder. --- source/blender/freestyle/intern/winged_edge/WEdge.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source/blender/freestyle/intern/winged_edge') diff --git a/source/blender/freestyle/intern/winged_edge/WEdge.cpp b/source/blender/freestyle/intern/winged_edge/WEdge.cpp index 1a3c9341374..31082e3376f 100755 --- a/source/blender/freestyle/intern/winged_edge/WEdge.cpp +++ b/source/blender/freestyle/intern/winged_edge/WEdge.cpp @@ -626,7 +626,12 @@ WFace* WShape::MakeFace(vector& iVertexList, unsigned iMaterial) // allocate the new face WFace *face = instanciateFace(); - return MakeFace(iVertexList, iMaterial, face); + WFace *result = MakeFace(iVertexList, iMaterial, face); + if (0 == result) { + delete face; + return 0; + } + return result; } WFace * WShape::MakeFace(vector& iVertexList, vector& iNormalsList, vector& iTexCoordsList, unsigned iMaterial) -- cgit v1.2.3