From 01b8c209de5b3ec6e00f8431053fba3e154dce4c Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Fri, 25 Oct 2024 15:34:43 -0400 Subject: [PATCH] core: Testing a theory to encourage clean shutdowns. --- src/ssb.connections.c | 2 +- src/task.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ssb.connections.c b/src/ssb.connections.c index 1e99f97f..27f5f6d6 100644 --- a/src/ssb.connections.c +++ b/src/ssb.connections.c @@ -21,7 +21,7 @@ typedef struct _tf_ssb_connections_t static void _tf_ssb_connections_changed_callback(tf_ssb_t* ssb, tf_ssb_change_t change, tf_ssb_connection_t* connection, void* user_data) { - if (!connection) + if (!connection || tf_ssb_is_shutting_down(ssb)) { return; } diff --git a/src/task.c b/src/task.c index 5eccbdfa..515b16a8 100644 --- a/src/task.c +++ b/src/task.c @@ -1869,6 +1869,7 @@ void tf_task_destroy(tf_task_t* task) { JSValue global = JS_GetGlobalObject(task->_context); JS_SetPropertyStr(task->_context, global, "httpd", JS_UNDEFINED); + JS_SetPropertyStr(task->_context, global, "gProcesses", JS_NewObject(task->_context)); JS_FreeValue(task->_context, global); }