From deae4d5367277f065673851c7624aede44e47be3 Mon Sep 17 00:00:00 2001 From: Cory McWilliams Date: Sat, 7 Jun 2025 13:19:46 -0400 Subject: [PATCH] ssb: Obviously close the readers before the writer. --- src/ssb.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/ssb.c b/src/ssb.c index 2e41a9a7..624e7c7b 100644 --- a/src/ssb.c +++ b/src/ssb.c @@ -2832,15 +2832,6 @@ void tf_ssb_destroy(tf_ssb_t* ssb) JS_FreeRuntime(ssb->runtime); ssb->own_context = false; } - if (ssb->db_writer) - { - int r = sqlite3_close(ssb->db_writer); - if (r != SQLITE_OK) - { - tf_printf("sqlite3_close: %s\n", sqlite3_errstr(r)); - } - ssb->db_writer = NULL; - } while (ssb->broadcasts) { tf_ssb_broadcast_t* broadcast = ssb->broadcasts; @@ -2856,6 +2847,15 @@ void tf_ssb_destroy(tf_ssb_t* ssb) tf_printf("sqlite3_close: %s\n", sqlite3_errstr(r)); } } + if (ssb->db_writer) + { + int r = sqlite3_close(ssb->db_writer); + if (r != SQLITE_OK) + { + tf_printf("sqlite3_close: %s\n", sqlite3_errstr(r)); + } + ssb->db_writer = NULL; + } ssb->db_readers_count = 0; if (ssb->db_readers) {