mirror of
https://github.com/mlua-rs/mlua
synced 2026-06-08 16:05:43 +00:00
Prepare for custom (Luau) userdata destructors.
We need to add logic later to prevent calling any Lua functions when UserData destructor is running.
This commit is contained in:
+2
-2
@@ -168,7 +168,7 @@ impl<'scope, 'env: 'scope> Scope<'scope, 'env> {
|
||||
#[cfg(feature = "luau")]
|
||||
let ud_ptr = {
|
||||
let data = UserDataStorage::new_scoped(data);
|
||||
util::push_userdata::<UserDataStorage<T>>(state, data, protect)?
|
||||
util::push_userdata(state, data, protect)?
|
||||
};
|
||||
#[cfg(not(feature = "luau"))]
|
||||
let ud_ptr = util::push_uninit_userdata::<UserDataStorage<T>>(state, protect)?;
|
||||
@@ -216,7 +216,7 @@ impl<'scope, 'env: 'scope> Scope<'scope, 'env> {
|
||||
#[cfg(feature = "luau")]
|
||||
let ud_ptr = {
|
||||
let data = UserDataStorage::new_scoped(data);
|
||||
util::push_userdata::<UserDataStorage<T>>(state, data, protect)?
|
||||
util::push_userdata(state, data, protect)?
|
||||
};
|
||||
#[cfg(not(feature = "luau"))]
|
||||
let ud_ptr = util::push_uninit_userdata::<UserDataStorage<T>>(state, protect)?;
|
||||
|
||||
Reference in New Issue
Block a user