diff options
-rw-r--r-- | src/thread.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/thread.rs b/src/thread.rs index 8db3e35..931aca9 100644 --- a/src/thread.rs +++ b/src/thread.rs @@ -399,7 +399,10 @@ impl<'lua, R> Drop for AsyncThread<'lua, R> { #[cfg(feature = "lua54")] if self.thread.status() == ThreadStatus::Error { let thread_state = ffi::lua_tothread(lua.ref_thread(), self.thread.0.index); + #[cfg(not(feature = "vendored"))] ffi::lua_resetthread(thread_state); + #[cfg(feature = "vendored")] + ffi::lua_closethread(thread_state, lua.state()); } } } |