about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libstore/sqlite.cc5
-rw-r--r--src/libstore/sqlite.hh2
2 files changed, 7 insertions, 0 deletions
diff --git a/src/libstore/sqlite.cc b/src/libstore/sqlite.cc
index 77fbedd119..f93fa08575 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 b953978417..326e4a4855 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);