When referencing a value like so:
lua_pushnumber(L, 1);
ref = luaL_ref(L, LUA_REGISTRYINDEX);
Is it harmless to unreference ref
multiple times or will this cause problems? i.e. is it harmless to call luaL_unref(L, LUA_REGISTRYINDEX, ref)
multiple times for the code above or must there be only one luaL_unref
call for each luaL_ref
call?