Removed unneeded queue_send and made closing the db more robust. Does this fix #20?
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user