From 6bd7d28e060e75d16ef54fb00ab016dda9179502 Mon Sep 17 00:00:00 2001 From: natural-law Date: Thu, 16 Sep 2010 09:19:18 +0000 Subject: [PATCH] issue #144 Clear memory leaks of the test_uphone project --- cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp | 2 +- test_uphone/tests/MenuTest/MenuTest.cpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp index be7baea188..509f7a4e73 100644 --- a/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp +++ b/cocos2dx/layers_scenes_transitions_nodes/CCLayer.cpp @@ -374,7 +374,7 @@ CCMultiplexLayer * CCMultiplexLayer::layerWithLayers(CCLayer * layer, ...) bool CCMultiplexLayer::initWithLayers(CCLayer *layer, va_list params) { m_pLayers = new NSMutableArray(5); - m_pLayers->retain(); + //m_pLayers->retain(); m_pLayers->addObject(layer); diff --git a/test_uphone/tests/MenuTest/MenuTest.cpp b/test_uphone/tests/MenuTest/MenuTest.cpp index 4de62ea1d2..3ed25b1a9f 100644 --- a/test_uphone/tests/MenuTest/MenuTest.cpp +++ b/test_uphone/tests/MenuTest/MenuTest.cpp @@ -426,5 +426,10 @@ void MenuTestScene::runThisTest() CCMultiplexLayer* layer = CCMultiplexLayer::layerWithLayers(pLayer1, pLayer2, pLayer3, pLayer4, NULL); addChild(layer, 0); + pLayer1->release(); + pLayer2->release(); + pLayer3->release(); + pLayer4->release(); + CCDirector::getSharedDirector()->replaceScene(this); }