[cocos2d-x-2.2] come out error [LUA ERROR] function refid '%d' does not reference a Lua function

What’s the issue?
running the app written in lua for a while, then come out the error [LUA ERROR] function refid ‘%d’ does not reference a Lua function, function calling fails.

What’s the engine version?
[cocos2d-x-2.2]

How to reproduce it?
when enter a layer, register a function as a callback function for a button, then add the button to layer, when exit the layer, delete the layer. after operating enter and exit the layer several times the error comes out.

is it because my engine version is too old? and it is fixed in later ones.
or because when exit the layer, only delete the layer is not enough?
THX

when exit the layer, delete the layer.after operating enter and exit the layer several times the error comes out.
– Can you paste your test codes.Thank you.