summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lua.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/lua.rs b/src/lua.rs
index 8b8ec3c..df34f9f 100644
--- a/src/lua.rs
+++ b/src/lua.rs
@@ -52,12 +52,8 @@ impl Drop for Lua {
fn drop(&mut self) {
unsafe {
if !self.ephemeral {
- if cfg!(test) {
- let top = ffi::lua_gettop(self.state);
- if top != 0 {
- rlua_abort!("Lua stack leak detected, stack top is {}", top);
- }
- }
+ let top = ffi::lua_gettop(self.state);
+ rlua_assert!(top == 0, "stack leak detected, stack top is {}", top);
let extra_data = *(ffi::lua_getextraspace(self.state) as *mut *mut ExtraData);
*(*extra_data).registry_unref_list.lock().unwrap() = None;