From 0ba2a32b2a9f8fdaca724c7fdbca69ee6cbed358 Mon Sep 17 00:00:00 2001 From: Bert Hubert Date: Tue, 10 Jan 2012 20:35:49 +0000 Subject: [PATCH] make sqlite3 code be able to deal with destruction while get() still running git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@2336 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- modules/gsqlite3backend/ssqlite3.cc | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/modules/gsqlite3backend/ssqlite3.cc b/modules/gsqlite3backend/ssqlite3.cc index a6425e2ac..c59e996e6 100644 --- a/modules/gsqlite3backend/ssqlite3.cc +++ b/modules/gsqlite3backend/ssqlite3.cc @@ -26,7 +26,7 @@ SSQLite3::SSQLite3( const std::string & database ) if ( sqlite3_open( database.c_str(), &m_pDB)!=SQLITE_OK ) throw sPerrorException( "Could not connect to the SQLite database '" + database + "'" ); - + m_pStmt = 0; sqlite3_busy_handler(m_pDB, busyHandler, 0); } @@ -34,9 +34,18 @@ SSQLite3::SSQLite3( const std::string & database ) SSQLite3::~SSQLite3() { int ret; - if((ret =sqlite3_close( m_pDB )) != SQLITE_OK) { - cerr<<"Unable to close down sqlite connection: "<