diff options
author | Andreas Baumann <abaumann@yahoo.com> | 2010-03-25 09:25:59 +0100 |
---|---|---|
committer | Andreas Baumann <abaumann@yahoo.com> | 2010-03-25 09:25:59 +0100 |
commit | d97b78e6d6978e9e288f1269f54bc820e378868f (patch) | |
tree | 086c38feef9e432c4ec79c070b9f576490ccb781 /src/connection.cpp | |
parent | 44e6b7e472c31f214ed41833621e65acebd8375a (diff) | |
download | sqlitexx-d97b78e6d6978e9e288f1269f54bc820e378868f.tar.gz sqlitexx-d97b78e6d6978e9e288f1269f54bc820e378868f.tar.bz2 |
fixed finalizing of prepared statements in destructor of connection
added a trace() method to get the tracing status
Diffstat (limited to 'src/connection.cpp')
-rw-r--r-- | src/connection.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/connection.cpp b/src/connection.cpp index ceb5d3e..30ab00a 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -56,7 +56,17 @@ connection::connection( const connection& c ) { connection::~connection( ) { assert( db != NULL ); - sqlite3_close( db ); + + // remove all prepared statements + for( PSMap::iterator it = prepared_stmts.begin( ); it != prepared_stmts.end( ); it++ ) { + delete (*it).second; + } + + // close database now + int rt = sqlite3_close( db ); + if( rt != SQLITE_OK ) { + cerr << "ERROR in destructor of connection: " << rt << endl; + } } extern "C" void profiling_callback( void *a, const char *b, sqlite3_uint64 c ) { |