CCControllButton has leak ... and solution.

I found memory leak in CCControlButton class.
Scheduling test method… create CCControllButton… again again again.
You can see memory leak by using Xcode instrument.

I think it must be modified in below.


in CCContolButton.cpp

CCControlButton::~CCControlButton()
{
CC_SAFE_RELEASE(m_backgroundSpriteDispatchTable);
CC_SAFE_RELEASE(m_titleLabelDispatchTable);
CC_SAFE_RELEASE(m_titleColorDispatchTable);
CC_SAFE_RELEASE(m_titleDispatchTable);
CC_SAFE_RELEASE(m_backgroundSprite);
CC_SAFE_RELEASE(m_titleLabel); //TODO: add this line
}

void CCControlButton::needsLayout()
{
….

//CC_SAFE_RELEASE(m_currentTitle);
m_currentTitle = getTitleForState(m_eState);
//CC_SAFE_RETAIN(m_currentTitle);

….

}


Thank you, issue #1553 was created.