Removed unneeded queue_send and made closing the db more robust. Does this fix #20?

This commit is contained in:
Maas-Maarten Zeeman
2015-08-02 16:55:36 +02:00
parent 584f76a67c
commit c295381715

View File

@@ -214,7 +214,6 @@ destruct_esqlite_connection(ErlNifEnv *env, void *arg)
*/ */
cmd->type = cmd_stop; cmd->type = cmd_stop;
queue_push(db->commands, cmd); queue_push(db->commands, cmd);
queue_send(db->commands, cmd);
/* Wait for the thread to finish /* Wait for the thread to finish
*/ */
@@ -226,8 +225,10 @@ destruct_esqlite_connection(ErlNifEnv *env, void *arg)
*/ */
queue_destroy(db->commands); queue_destroy(db->commands);
if(db->db) if(db->db) {
sqlite3_close_v2(db->db); sqlite3_close_v2(db->db);
db->db = NULL;
}
} }
static void static void