Use `lua_closethread` in `AsyncThread::drop()`

This commit is contained in:
Alex Orlenko 2023-05-28 01:43:15 +01:00
parent b674d7906d
commit 6dee339783
No known key found for this signature in database
GPG Key ID: 4C150C250863B96D
1 changed files with 3 additions and 0 deletions

View File

@ -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());
}
}
}