Whenever the referenced object is needed, a call to lua_getref returns a handle to it, while lua_pushref pushes the object on the stack. If the object has been collected, lua_getref returns LUA_NOOBJECT , and lua_pushobject issues an error.
Really "lua_pushobject"? Is that correct? It seems like that is a typo and it should say lua_pushref.