From c4ab29584620dacf93c717ba76fd5595bd667161 Mon Sep 17 00:00:00 2001 From: minggo Date: Sun, 9 Jun 2013 14:36:16 +0800 Subject: [PATCH] issue #2271: fixed memory leak of CCControlColorPicker --- .../CCControlColourPicker.cpp | 21 +++---------------- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp b/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp index e96ddbdf58..7745a5f6ea 100644 --- a/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp +++ b/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp @@ -46,24 +46,9 @@ CCControlColourPicker::CCControlColourPicker() CCControlColourPicker::~CCControlColourPicker() { - if (m_background) - { - m_background->removeFromParentAndCleanup(true); - } - - if (m_huePicker) - { - m_huePicker->removeFromParentAndCleanup(true); - } - - if (m_colourPicker) - { - m_colourPicker->removeFromParentAndCleanup(true); - } - - m_background = NULL; - m_huePicker = NULL; - m_colourPicker = NULL; + CC_SAFE_RELEASE(m_background); + CC_SAFE_RELEASE(m_huePicker); + CC_SAFE_RELEASE(m_colourPicker); } bool CCControlColourPicker::init()