bug: lua event callback problem

hi all:

My English is not very good, hope that will not affects our communication.

problem:

On the lua side, register a event callback into the C*+ side like:registerScriptHandler.
C*+ code that method:
toluafix_ref_function, in the method,c++ side registry it, save it’s callback method and incrementing key s_function_ref_id to lua’s table “toluafix_refid_function_mapping”

on remove the callback’s method, call toluafix_remove_function_by_refid method, the method use before saved incrementing key to remove the table “toluafix_refid_function_mapping” inner saved callback method.

but some Objests, etc.(CCLayer) ,don’t call the toluafix_remove_function_by_refid method, it’s only destroy the entry flag. lead to table “toluafix_refid_function_mapping” memory leak。

….how to cancel the code block background.:frowning:

WOW…OK.

in some Objects just like CCLayer,
unregisterScriptHandler method trigger ScriptHandlerEntry instance release,
and on ScriptHandlerEntry instance destruct, call the toluafix_remove_function_by_refid method.

BUT, other some Objects like CCItem,
in unregisterScriptHandler direct call the toluafix_remove_function_by_refid method.

HOPE FOR UNIFORM STYLE. :wink: