why need call toluafix_pushusertype_ccobject ?

why need call toluafix_pushusertype_ccobject ?
0.0 0


C的接口使用tolua转换为lua可调用的接口时,接口代码中会自动调用 toluafix_pushusertype_ccobject 记录了CCObject对象的指针以及类型名称,调用这个函数的目的是什么呢?我没有看到在引擎代码中使用这些信息。


When CCObject destruct, destructor will call toluafix_remove_ccobject_by_refid , this function will get script object ptr and type from data recorded in toluafix_pushusertype_ccobject.Using these information , toluafix_remove_ccobject_by_refid will set script object userdata to NULL.Then , if you still use this script object after destructor called, you will get a assert error. I think the function is quick error detect.