From 5ce950b9618055ec47e96d01cfb54159e5936639 Mon Sep 17 00:00:00 2001 From: James Chen Date: Tue, 17 Apr 2012 16:37:04 +0800 Subject: [PATCH] fixed a memory leak in CCControl. --- cocos2dx/extensions/CCControlExtension/CCControl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos2dx/extensions/CCControlExtension/CCControl.cpp b/cocos2dx/extensions/CCControlExtension/CCControl.cpp index 94d5483630..0504563827 100644 --- a/cocos2dx/extensions/CCControlExtension/CCControl.cpp +++ b/cocos2dx/extensions/CCControlExtension/CCControl.cpp @@ -293,7 +293,7 @@ CCArray* CCControl::dispatchListforControlEvent(CCControlEvent controlEvent) // If the invocation list does not exist for the dispatch table, we create it if (invocationList == NULL) { - invocationList=new CCArray(); + invocationList = CCArray::arrayWithCapacity(1); dispatchTable->setObject(invocationList, controlEvent); } return invocationList;