mirror of https://github.com/axmolengine/axmol.git
Fixed #12834 Invoke cleanup function when override in JS
This commit is contained in:
parent
365c51cfab
commit
efffea5b91
|
@ -1034,6 +1034,11 @@ int ScriptingCore::handleNodeEvent(void* data)
|
||||||
}
|
}
|
||||||
else if (action == kNodeOnCleanup) {
|
else if (action == kNodeOnCleanup) {
|
||||||
cleanupSchedulesAndActions(p);
|
cleanupSchedulesAndActions(p);
|
||||||
|
|
||||||
|
if (isFunctionOverridedInJS(JS::RootedObject(_cx, p->obj.get()), "cleanup", js_cocos2dx_Node_cleanup))
|
||||||
|
{
|
||||||
|
ret = executeFunctionWithOwner(OBJECT_TO_JSVAL(p->obj), "cleanup", 1, &dataVal, &retval);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -176,7 +176,7 @@ var TestController = cc.LayerGradient.extend({
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}, this);
|
}, this);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onEnter:function(){
|
onEnter:function(){
|
||||||
this._super();
|
this._super();
|
||||||
|
|
Loading…
Reference in New Issue