We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a67be10 commit 81ce454Copy full SHA for 81ce454
1 file changed
lua/hvlua.c
@@ -184,6 +184,7 @@ HvLuaCoroutine* hvlua_suspend(lua_State* L) {
184
185
lua_State* hvlua_coroutine_state(HvLuaCoroutine* co) {
186
if (co == NULL || co->ref == LUA_NOREF) return NULL;
187
+ if (co->owner && co->owner->closing) return NULL;
188
return co->L;
189
}
190
@@ -201,6 +202,10 @@ void hvlua_resume(HvLuaCoroutine* co, int nresults) {
201
202
lua_State* L;
203
int ref;
204
if (co == NULL) return;
205
+ if (co->owner && co->owner->closing) {
206
+ hvlua_cancel(co);
207
+ return;
208
+ }
209
if (co->ref == LUA_NOREF) { // stale: already resumed/freed
210
HV_FREE(co);
211
return;
0 commit comments