Commit f904f997 by Konstantin Käfer

make sure that the async handler is properly stopped when the database is closed or destructed

parent d21e2069
......@@ -214,6 +214,11 @@ int Database::EIO_Close(eio_req *req) {
Baton* baton = static_cast<Baton*>(req->data);
Database* db = baton->db;
if (db->debug_trace) {
delete db->debug_trace;
db->debug_trace = NULL;
}
baton->status = sqlite3_close(db->handle);
if (baton->status != SQLITE_OK) {
......@@ -472,6 +477,11 @@ void Database::Destruct(Persistent<Value> value, void *data) {
int Database::EIO_Destruct(eio_req *req) {
Database* db = static_cast<Database*>(req->data);
if (db->debug_trace) {
delete db->debug_trace;
db->debug_trace = NULL;
}
sqlite3_close(db->handle);
db->handle = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment