diff --git a/src/ssb.connections.c b/src/ssb.connections.c index 38d58174..c2cad022 100644 --- a/src/ssb.connections.c +++ b/src/ssb.connections.c @@ -103,6 +103,7 @@ static void _tf_ssb_connections_get_next_after_work(uv_work_t* work, int status) tf_ssb_connect(next->ssb, next->host, next->port, key_bin); } } + tf_ssb_unref(next->ssb); tf_free(next); } @@ -123,6 +124,7 @@ static void _tf_ssb_connections_timer(uv_timer_t* timer) .ssb = connections->ssb, .connections = connections, }; + tf_ssb_ref(connections->ssb); int result = uv_queue_work(tf_ssb_get_loop(connections->ssb), &next->work, _tf_ssb_connections_get_next_work, _tf_ssb_connections_get_next_after_work); if (result) {