From 1c1544f5297f88bbbcbbad2d21c4ec7b62bb9a28 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 30 Aug 2011 16:10:02 +0200 Subject: Implement uniform handle management across all databases Also use the auto_handle template instead of the raw handle in connection, statement, and result classes. This removes a lot of brittle "exception safety guarantee" code that we had in those classes. --- odb/sqlite/statement.hxx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'odb/sqlite/statement.hxx') diff --git a/odb/sqlite/statement.hxx b/odb/sqlite/statement.hxx index 5ddb56b..1d48cd4 100644 --- a/odb/sqlite/statement.hxx +++ b/odb/sqlite/statement.hxx @@ -20,6 +20,8 @@ #include #include #include +#include + #include namespace odb @@ -131,19 +133,14 @@ namespace odb finilize () { list_remove (); - - if (stmt_ != 0) - { - sqlite3_finalize (stmt_); - stmt_ = 0; - } + stmt_.reset (); } protected: friend class connection; connection& conn_; - sqlite3_stmt* stmt_; + auto_handle stmt_; bool active_; bool cached_; -- cgit v1.1