mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-20 23:52:40 +08:00
fix memory leaks of graphics node
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user