fix memory leaks of graphics node

This commit is contained in:
zilongshanren
2017-01-24 11:45:39 +08:00
parent 60f8d20c82
commit 052e40a9f8
2 changed files with 8 additions and 2 deletions
@@ -385,6 +385,11 @@ void GraphicsNode::clear(bool clean)
CC_SAFE_DELETE(_verts);
CC_SAFE_DELETE(_indices);
for(auto&& it : _commands) {
delete it;
}
_commands.clear();
}
_nPoints = 0;
@@ -1276,4 +1281,4 @@ void GraphicsNode::onDraw(const Mat4 &transform, uint32_t flags)
CHECK_GL_ERROR_DEBUG();
}
}
}
@@ -101,6 +101,7 @@ bool Triangulate::process(const VecVertex *contour, int offset, int n, std::vect
if (0 >= (count--))
{
//** Triangulate: ERROR - probable bad polygon!
delete []V;
return false;
}
@@ -136,4 +137,4 @@ bool Triangulate::process(const VecVertex *contour, int offset, int n, std::vect
delete []V;
return true;
}
}