mirror of
https://github.com/mlua-rs/mlua
synced 2026-06-08 16:05:43 +00:00
Execute metatable destructor in Table::set_metatable at the end of invocation
Before this change, destructor was executed shortly after pushing metatable to ref_thread.
This commit is contained in:
+1
-1
@@ -510,7 +510,7 @@ impl Table {
|
||||
let lua = self.0.lua.lock();
|
||||
let ref_thread = lua.ref_thread();
|
||||
unsafe {
|
||||
if let Some(metatable) = metatable {
|
||||
if let Some(metatable) = &metatable {
|
||||
ffi::lua_pushvalue(ref_thread, metatable.0.index);
|
||||
} else {
|
||||
ffi::lua_pushnil(ref_thread);
|
||||
|
||||
Reference in New Issue
Block a user