Merge pull request #1690 from dualface/fix_CCCallFunc_script_support

Fix cc call func script support
This commit is contained in:
minggo 2012-12-02 18:26:05 -08:00
commit af530878fd
2 changed files with 12 additions and 6 deletions

View File

@ -406,6 +406,15 @@ bool CCCallFunc::initWithTarget(CCObject* pSelectorTarget) {
return true;
}
CCCallFunc::~CCCallFunc(void)
{
if (m_nScriptHandler)
{
cocos2d::CCScriptEngineManager::sharedManager()->getScriptEngine()->removeScriptHandler(m_nScriptHandler);
}
CC_SAFE_RELEASE(m_pSelectorTarget);
}
CCObject * CCCallFunc::copyWithZone(CCZone *pZone) {
CCZone* pNewZone = NULL;
CCCallFunc* pRet = NULL;

View File

@ -215,15 +215,12 @@ class CC_DLL CCCallFunc : public CCActionInstant //<NSCopying>
public:
CCCallFunc()
: m_pSelectorTarget(NULL)
, m_nScriptHandler(0)
, m_pCallFunc(NULL)
, m_nScriptHandler(0)
{
}
virtual ~CCCallFunc()
{
CC_SAFE_RELEASE(m_pSelectorTarget);
}
/** creates the action with the callback
virtual ~CCCallFunc();
/** creates the action with the callback
@deprecated: This interface will be deprecated sooner or later.
typedef void (CCObject::*SEL_CallFunc)();
*/