diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2010-06-03 19:04:55 +0400 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2010-06-03 19:04:55 +0400 |
commit | c0d18491b6493c55c7239eaee0ae84eea1581667 (patch) | |
tree | 298ead558c196ff9f8fa6a7000467ed035e3540a /source/blender/freestyle/intern/winged_edge | |
parent | 8fe1d461e34caa5c017f56cee7b4d07038a9bf03 (diff) |
Fix for a memory leak in WingedEdgeBuilder.
Diffstat (limited to 'source/blender/freestyle/intern/winged_edge')
-rwxr-xr-x | source/blender/freestyle/intern/winged_edge/WEdge.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
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<WVertex*>& 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<WVertex*>& iVertexList, vector<Vec3r>& iNormalsList, vector<Vec2r>& iTexCoordsList, unsigned iMaterial) |