mirror of https://github.com/axmolengine/axmol.git
issue #61: should retain in void to memory leak
This commit is contained in:
parent
642f2a297b
commit
d9e1134840
|
@ -336,9 +336,9 @@ namespace cocos2d{
|
|||
CCMenuItemSprite * CCMenuItemSprite::initFromNormalSprite(CCNode* normalSprite, CCNode* selectedSprite, CCNode* disabledSprite, SelectorProtocol* target, SEL_MunuHandler selector)
|
||||
{
|
||||
CCMenuItem::initWithTarget(target, selector);
|
||||
this->m_pNormalImage = normalSprite;
|
||||
this->m_pSelectedImage = selectedSprite;
|
||||
this->m_pDisabledImage = disabledSprite;
|
||||
this->m_pNormalImage = normalSprite; CCX_SAFE_RETAIN(normalSprite);
|
||||
this->m_pSelectedImage = selectedSprite; CCX_SAFE_RETAIN(selectedSprite);
|
||||
this->m_pDisabledImage = disabledSprite; CCX_SAFE_RETAIN(disabledSprite);
|
||||
this->setContentSize(m_pNormalImage->getContentSize());
|
||||
return this;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue