core: Never-ending quest to fix clean shutdown.
Some checks failed
Build Tilde Friends / Build-All (push) Has been cancelled

This commit is contained in:
2025-08-20 20:20:21 -04:00
parent 55d69d7c13
commit e8210c6fdd

View File

@@ -2806,6 +2806,16 @@ void tf_ssb_destroy(tf_ssb_t* ssb)
uv_run(ssb->loop, UV_RUN_NOWAIT); uv_run(ssb->loop, UV_RUN_NOWAIT);
if (ssb->own_context)
{
if (!ssb->quiet)
{
tf_printf("closing ssb context\n");
}
JS_FreeContext(ssb->context);
JS_FreeRuntime(ssb->runtime);
ssb->own_context = false;
}
if (ssb->loop == &ssb->own_loop) if (ssb->loop == &ssb->own_loop)
{ {
if (!ssb->quiet) if (!ssb->quiet)
@@ -2822,16 +2832,6 @@ void tf_ssb_destroy(tf_ssb_t* ssb)
{ {
tf_printf("uv loop closed.\n"); tf_printf("uv loop closed.\n");
} }
if (ssb->own_context)
{
if (!ssb->quiet)
{
tf_printf("closing ssb context\n");
}
JS_FreeContext(ssb->context);
JS_FreeRuntime(ssb->runtime);
ssb->own_context = false;
}
while (ssb->broadcasts) while (ssb->broadcasts)
{ {
tf_ssb_broadcast_t* broadcast = ssb->broadcasts; tf_ssb_broadcast_t* broadcast = ssb->broadcasts;