Skip to content

Commit

Permalink
issue #2271: fixed memory leak of CCControlColorPicker
Browse files Browse the repository at this point in the history
  • Loading branch information
minggo committed Jun 9, 2013
1 parent bd660e7 commit f00baac
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions extensions/GUI/CCControlExtension/CCControlColourPicker.cpp
Expand Up @@ -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()
Expand Down

0 comments on commit f00baac

Please sign in to comment.