diff --git a/source/cell.c b/source/cell.c index 10ea8182..87ec93d1 100644 --- a/source/cell.c +++ b/source/cell.c @@ -314,6 +314,7 @@ int prosperon_mount_core(void) void actor_unneeded(cell_rt *actor, JSValue fn, double seconds) { + if (actor->disrupt) return; JS_FreeValue(actor->context, actor->unneeded); if (!JS_IsFunction(actor->context, fn)) { @@ -412,6 +413,8 @@ const char *send_message(const char *id, void *msg) static Uint32 actor_remove_cb(Uint32 id, Uint32 interval, cell_rt *actor) { + actor->disrupt = 1; + if (!JS_IsUndefined(actor->unneeded)) { SDL_LockMutex(actor->mutex); JSValue ret = JS_Call(actor->context, actor->unneeded, JS_UNDEFINED, 0, NULL);