From 80da7a637559aadb6544599adc9f5807188cb9e5 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 5 Apr 2016 15:29:56 +0200 Subject: [PATCH] Probably fix SQLITE_BUSY errors --- src/libstore/sqlite.cc | 5 +++++ src/libstore/sqlite.hh | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/libstore/sqlite.cc b/src/libstore/sqlite.cc index 77fbedd11..f93fa0857 100644 --- a/src/libstore/sqlite.cc +++ b/src/libstore/sqlite.cc @@ -73,6 +73,11 @@ SQLiteStmt::Use::Use(SQLiteStmt & stmt) sqlite3_reset(stmt); } +SQLiteStmt::Use::~Use() +{ + sqlite3_reset(stmt); +} + SQLiteStmt::Use & SQLiteStmt::Use::operator () (const std::string & value, bool notNull) { if (notNull) { diff --git a/src/libstore/sqlite.hh b/src/libstore/sqlite.hh index b95397841..326e4a485 100644 --- a/src/libstore/sqlite.hh +++ b/src/libstore/sqlite.hh @@ -40,6 +40,8 @@ struct SQLiteStmt public: + ~Use(); + /* Bind the next parameter. */ Use & operator () (const std::string & value, bool notNull = true); Use & operator () (int64_t value, bool notNull = true);