Skip to content

Commit 7f8b1cc

Browse files
committed
Fix don't destroy mutex if it is not set
1 parent aae4731 commit 7f8b1cc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

c_src/sqlite3_nif.c

+4
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,11 @@ connection_type_destructor(ErlNifEnv* env, void* arg)
886886
if (conn->db) {
887887
sqlite3_close_v2(conn->db);
888888
conn->db = NULL;
889+
}
890+
891+
if (conn->mutex) {
889892
enif_mutex_destroy(conn->mutex);
893+
conn->mutex = NULL;
890894
}
891895
}
892896

0 commit comments

Comments
 (0)