summaryrefslogtreecommitdiff
path: root/src/lua.rs
diff options
context:
space:
mode:
authorAlex Orlenko <zxteam@protonmail.com>2023-04-23 10:03:16 +0100
committerAlex Orlenko <zxteam@protonmail.com>2023-04-23 10:56:26 +0100
commit2d6a0fdf9cd468e3d5d3f3aa33426e84b4ceebfd (patch)
treec73bfc69084923916463241f1a1fd5c042f26255 /src/lua.rs
parentd0cbd32ad2663c5ab22f7571f18f7becc83fbba2 (diff)
downloadmlua-2d6a0fdf9cd468e3d5d3f3aa33426e84b4ceebfd.zip
Check for reference leak detection only in mlua integratin tests.
This is not necessary an error and should not be enforced by default. Fixes #268.
Diffstat (limited to 'src/lua.rs')
-rw-r--r--src/lua.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lua.rs b/src/lua.rs
index e5decdf..ec2df98 100644
--- a/src/lua.rs
+++ b/src/lua.rs
@@ -247,6 +247,8 @@ impl Drop for LuaInner {
{
(*ffi::lua_callbacks(self.state())).userdata = ptr::null_mut();
}
+ // This is an internal assertion used in integration tests
+ #[cfg(mlua_test)]
mlua_debug_assert!(
ffi::lua_gettop(extra.ref_thread) == extra.ref_stack_top
&& extra.ref_stack_top as usize == extra.ref_free.len(),