Missed unprotected call to luaL_ref

This commit is contained in:
kyren 2017-12-17 16:55:37 -05:00
parent 443054f753
commit 685fc12aad
1 changed files with 3 additions and 1 deletions

View File

@ -807,7 +807,9 @@ impl Lua {
ffi::lua_rawset(state, -3);
})?;
let id = ffi::luaL_ref(self.state, ffi::LUA_REGISTRYINDEX);
let id = gc_guard(self.state, || {
ffi::luaL_ref(self.state, ffi::LUA_REGISTRYINDEX)
});
(*registered_userdata).insert(TypeId::of::<T>(), id);
Ok(id)
})