A lua binder likes library luabind, but this binder takes the c++ object life and lua userdata life into account(you can check whether a c++ object is exported to lua and whether a lua object is imported from a c++ object)