Update push_userdata_ref
This commit is contained in:
parent
cfa959e599
commit
e01af22bac
|
@ -2591,6 +2591,7 @@ impl Lua {
|
||||||
pub(crate) unsafe fn push_userdata_ref(&self, lref: &LuaRef) -> Result<Option<TypeId>> {
|
pub(crate) unsafe fn push_userdata_ref(&self, lref: &LuaRef) -> Result<Option<TypeId>> {
|
||||||
self.push_ref(lref);
|
self.push_ref(lref);
|
||||||
if ffi::lua_getmetatable(self.state, -1) == 0 {
|
if ffi::lua_getmetatable(self.state, -1) == 0 {
|
||||||
|
ffi::lua_pop(self.state, 1);
|
||||||
return Err(Error::UserDataTypeMismatch);
|
return Err(Error::UserDataTypeMismatch);
|
||||||
}
|
}
|
||||||
let mt_ptr = ffi::lua_topointer(self.state, -1);
|
let mt_ptr = ffi::lua_topointer(self.state, -1);
|
||||||
|
|
Loading…
Reference in New Issue