From c295381715b172910d3c4fb87a42cc1879b5cfeb Mon Sep 17 00:00:00 2001 From: Maas-Maarten Zeeman Date: Sun, 2 Aug 2015 16:55:36 +0200 Subject: [PATCH] Removed unneeded queue_send and made closing the db more robust. Does this fix #20? --- c_src/esqlite3_nif.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/c_src/esqlite3_nif.c b/c_src/esqlite3_nif.c index 7852dbd..1727ed6 100644 --- a/c_src/esqlite3_nif.c +++ b/c_src/esqlite3_nif.c @@ -214,7 +214,6 @@ destruct_esqlite_connection(ErlNifEnv *env, void *arg) */ cmd->type = cmd_stop; queue_push(db->commands, cmd); - queue_send(db->commands, cmd); /* Wait for the thread to finish */ @@ -226,8 +225,10 @@ destruct_esqlite_connection(ErlNifEnv *env, void *arg) */ queue_destroy(db->commands); - if(db->db) + if(db->db) { sqlite3_close_v2(db->db); + db->db = NULL; + } } static void