aboutsummaryrefslogtreecommitdiff
path: root/odb/sqlite/statement.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/sqlite/statement.cxx')
-rw-r--r--odb/sqlite/statement.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/odb/sqlite/statement.cxx b/odb/sqlite/statement.cxx
index 0fe52f3..d0020d5 100644
--- a/odb/sqlite/statement.cxx
+++ b/odb/sqlite/statement.cxx
@@ -31,10 +31,11 @@ namespace odb
init (const char* s, std::size_t n)
{
int e;
+ sqlite3_stmt* stmt (0);
while ((e = sqlite3_prepare_v2 (conn_.handle (),
s,
static_cast<int> (n),
- &stmt_,
+ &stmt,
0)) == SQLITE_LOCKED)
{
conn_.wait ();
@@ -43,6 +44,8 @@ namespace odb
if (e != SQLITE_OK)
translate_error (e, conn_);
+ stmt_.reset (stmt);
+
active_ = false;
cached_ = false;