I have a lua table that I have added to the registry. I added some user date to the table and removed the data from the local stack.
lua_rawseti(luaState, LUA_REGISTRYINDEX, index);
lua_rawgeti(luaState, LUA_REGISTRYINDEX, index);
lua_setfield(luaState, 1, "userdata");
I then use the data in my program for a while. Eventually I am done, and want to remove the table and the user data from the Lua state by indicating they can be garbage collected. Is this all I need to do? Or do I need some special steps because of the user data in the table?