mirror of https://github.com/axmolengine/axmol.git
issue #175, add retain for CCCallFunc::m_pSelectorTarget
This commit is contained in:
parent
6d658b341c
commit
72aee0eace
|
@ -269,6 +269,14 @@ namespace cocos2d {
|
|||
}
|
||||
bool CCCallFunc::initWithTarget(SelectorProtocol* pSelectorTarget)
|
||||
{
|
||||
if (pSelectorTarget)
|
||||
{
|
||||
pSelectorTarget->selectorProtocolRetain();
|
||||
}
|
||||
if (m_pSelectorTarget)
|
||||
{
|
||||
m_pSelectorTarget->selectorProtocolRelease();
|
||||
}
|
||||
m_pSelectorTarget = pSelectorTarget;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -172,6 +172,10 @@ namespace cocos2d {
|
|||
}
|
||||
virtual ~CCCallFunc()
|
||||
{
|
||||
if (m_pSelectorTarget)
|
||||
{
|
||||
m_pSelectorTarget->selectorProtocolRelease();
|
||||
}
|
||||
}
|
||||
/** creates the action with the callback
|
||||
|
||||
|
|
Loading…
Reference in New Issue