diff --git a/cocos/2d/CCDrawNode.cpp b/cocos/2d/CCDrawNode.cpp index cd6f6f2c03..55005e10f7 100644 --- a/cocos/2d/CCDrawNode.cpp +++ b/cocos/2d/CCDrawNode.cpp @@ -536,7 +536,7 @@ void DrawNode::drawCircle(const Vec2 ¢er, float radius, float angle, unsigne void DrawNode::drawQuadBezier(const Vec2 &origin, const Vec2 &control, const Vec2 &destination, unsigned int segments, const Color4F &color) { - Vec2* vertices = new Vec2[segments + 1]; + Vec2* vertices = new (std::nothrow) Vec2[segments + 1]; if( ! vertices ) return; diff --git a/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.cpp b/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.cpp index d1cc45a714..9af98ad05d 100644 --- a/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.cpp +++ b/tests/cpp-tests/Classes/ClippingNodeTest/ClippingNodeTest.cpp @@ -924,10 +924,10 @@ void RawStencilBufferTest6::setupStencilForClippingOnPlane(GLint plane) Vec2 pt = Director::getInstance()->getWinSize(); Vec2 vertices[] = { - Vec2::ZERO, - Vec2(pt.x, 0), - pt, - Vec2(0, pt.y) + Vec2::ZERO, + Vec2(pt.x, 0), + pt, + Vec2(0, pt.y) }; auto glProgram = GLProgramCache::getInstance()->getGLProgram(GLProgram::SHADER_NAME_POSITION_U_COLOR);