From 59574f95e09a0f51a547f1d538155be499d9d9f7 Mon Sep 17 00:00:00 2001 From: "Wilson E. Alvarez" Date: Mon, 26 Sep 2016 02:18:48 -0400 Subject: [PATCH] Fix mismatched memory deallocators (#16596) * Fix mismatched memory deallocator in CCFastTMXLayer.cpp * Fix mismatched memory deallocator on SkeletonRenderer.cpp * Fix mismatched memory deallocator in CCTMXLayer.cpp --- cocos/2d/CCFastTMXLayer.cpp | 2 +- cocos/2d/CCTMXLayer.cpp | 2 +- cocos/editor-support/spine/SkeletonRenderer.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cocos/2d/CCFastTMXLayer.cpp b/cocos/2d/CCFastTMXLayer.cpp index e4bf2646b3..c003c7143e 100644 --- a/cocos/2d/CCFastTMXLayer.cpp +++ b/cocos/2d/CCFastTMXLayer.cpp @@ -130,7 +130,7 @@ TMXLayer::~TMXLayer() { CC_SAFE_RELEASE(_tileSet); CC_SAFE_RELEASE(_texture); - CC_SAFE_DELETE_ARRAY(_tiles); + CC_SAFE_FREE(_tiles); CC_SAFE_RELEASE(_vData); CC_SAFE_RELEASE(_vertexBuffer); CC_SAFE_RELEASE(_indexBuffer); diff --git a/cocos/2d/CCTMXLayer.cpp b/cocos/2d/CCTMXLayer.cpp index aff4c26f7b..8f38af5e5f 100644 --- a/cocos/2d/CCTMXLayer.cpp +++ b/cocos/2d/CCTMXLayer.cpp @@ -152,7 +152,7 @@ void TMXLayer::releaseMap() { if (_tiles) { - delete [] _tiles; + free(_tiles); _tiles = nullptr; } diff --git a/cocos/editor-support/spine/SkeletonRenderer.cpp b/cocos/editor-support/spine/SkeletonRenderer.cpp index 8864b97330..2a86d623a7 100644 --- a/cocos/editor-support/spine/SkeletonRenderer.cpp +++ b/cocos/editor-support/spine/SkeletonRenderer.cpp @@ -98,7 +98,7 @@ SkeletonRenderer::~SkeletonRenderer () { spSkeleton_dispose(_skeleton); if (_atlas) spAtlas_dispose(_atlas); if (_attachmentLoader) spAttachmentLoader_dispose(_attachmentLoader); - delete _worldVertices; + delete [] _worldVertices; } void SkeletonRenderer::initWithData (spSkeletonData* skeletonData, bool ownsSkeletonData) {