Commit 001dcf80 by Konstantin Käfer

Merge branch 'master' of https://github.com/carter-thaxton/node-sqlite3 into carter-thaxton-master

parents b8f718c7 d74f2e23
...@@ -89,6 +89,9 @@ public: ...@@ -89,6 +89,9 @@ public:
std::string table; std::string table;
sqlite3_int64 rowid; sqlite3_int64 rowid;
}; };
bool IsOpen() { return open; }
bool IsLocked() { return locked; }
typedef Async<std::string, Database> AsyncTrace; typedef Async<std::string, Database> AsyncTrace;
typedef Async<ProfileInfo, Database> AsyncProfile; typedef Async<ProfileInfo, Database> AsyncProfile;
......
...@@ -134,7 +134,7 @@ public: ...@@ -134,7 +134,7 @@ public:
} }
virtual ~PrepareBaton() { virtual ~PrepareBaton() {
stmt->Unref(); stmt->Unref();
if (!db->open && db->locked) { if (!db->IsOpen() && db->IsLocked()) {
// The database handle was closed before the statement could be // The database handle was closed before the statement could be
// prepared. // prepared.
stmt->Finalize(); stmt->Finalize();
......
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