dukky: Don't allow js_exec on a thread pending destruction

Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This commit is contained in:
Daniel Silverstone 2020-04-26 15:46:54 +01:00
parent 2cb33b0c33
commit d3d17ded9c
No known key found for this signature in database
GPG Key ID: C30DF439F2987D74

View File

@ -925,6 +925,11 @@ js_exec(jsthread *thread, const uint8_t *txt, size_t txtlen, const char *name)
return false;
}
if (thread->pending_destroy) {
NSLOG(dukky, DEEPDEBUG, "Skipping exec call because thread is dead");
return false;
}
dukky_enter_thread(thread);
duk_set_top(CTX, 0);