From b49d3e5e0e58e69b4fde856e37f73d101b5b2c0a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 10 Aug 2010 13:57:24 +0200 Subject: Delay closing statement until there are no active statements --- odb/mysql/statement.cxx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'odb/mysql/statement.cxx') diff --git a/odb/mysql/statement.cxx b/odb/mysql/statement.cxx index 981c756..009e3f1 100644 --- a/odb/mysql/statement.cxx +++ b/odb/mysql/statement.cxx @@ -5,8 +5,6 @@ #include // ER_DUP_ENTRY -#include // std::bad_alloc - #include #include #include @@ -22,18 +20,15 @@ namespace odb statement:: statement (connection& conn) - : conn_ (conn) + : conn_ (conn), stmt_ (conn_.alloc_stmt_handle ()) { - stmt_ = mysql_stmt_init (conn_.handle ()); - if (stmt_ == 0) - throw bad_alloc (); } statement:: ~statement () { - mysql_stmt_close (stmt_); + conn_.free_stmt_handle (stmt_); } void statement:: -- cgit v1.1