/* Remove previous value. */
if (hlua->Mref != -1)
- luaL_unref(L, hlua->Mref, LUA_REGISTRYINDEX);
+ luaL_unref(L, LUA_REGISTRYINDEX, hlua->Mref);
/* Get and store new value. */
lua_pushvalue(L, 2); /* Copy the element 2 at the top of the stack. */
/* Remove previous value. */
if (hlua->Mref != -1)
- luaL_unref(L, hlua->Mref, LUA_REGISTRYINDEX);
+ luaL_unref(L, LUA_REGISTRYINDEX, hlua->Mref);
/* Get and store new value. */
lua_pushvalue(L, 2); /* Copy the element 2 at the top of the stack. */
/* Remove previous value. */
if (hlua->Mref != -1)
- luaL_unref(L, hlua->Mref, LUA_REGISTRYINDEX);
+ luaL_unref(L, LUA_REGISTRYINDEX, hlua->Mref);
/* Get and store new value. */
lua_pushvalue(L, 2); /* Copy the element 2 at the top of the stack. */