core: Don't start new tasks as we're shutting down. #108
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 31m40s

This commit is contained in:
2025-04-20 18:26:44 -04:00
parent e7a03e3283
commit 2a5375b1e7
3 changed files with 20 additions and 0 deletions

View File

@ -125,6 +125,11 @@ static void _tf_taskstub_packetstream_close(void* user_data)
static JSValue _taskstub_create(JSContext* context, JSValueConst this_val, int argc, JSValueConst* argv)
{
tf_task_t* parent = tf_task_get(context);
if (parent && tf_task_is_shutting_down(parent))
{
return JS_UNDEFINED;
}
tf_taskstub_t* stub = tf_malloc(sizeof(tf_taskstub_t));
memset(stub, 0, sizeof(*stub));
stub->_stream = tf_packetstream_create();