summaryrefslogtreecommitdiff
path: root/src/thread.rs
diff options
context:
space:
mode:
authorAlex Orlenko <zxteam@protonmail.com>2023-05-28 01:43:15 +0100
committerAlex Orlenko <zxteam@protonmail.com>2023-05-28 01:43:15 +0100
commit6dee339783b2defc608eec3c958945811c75c463 (patch)
tree67022a9f9edd4eb37b5d5bd2c209f310bf251acc /src/thread.rs
parentb674d7906d1e378650c42d375abd67981a878c56 (diff)
downloadmlua-6dee339783b2defc608eec3c958945811c75c463.zip
Use `lua_closethread` in `AsyncThread::drop()`
Diffstat (limited to 'src/thread.rs')
-rw-r--r--src/thread.rs3
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());
}
}
}