fixed double call to sqlite3_close()

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7237 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2014-04-05 15:30:48 +00:00
parent e3c6816713
commit 679efe2ff3

View File

@ -72,16 +72,14 @@ RetroDb::RetroDb(const std::string &dbPath, int flags, const std::string& key) :
RetroDb::~RetroDb(){ RetroDb::~RetroDb(){
if(mDb) sqlite3_close(mDb); // no-op if mDb is NULL (https://www.sqlite.org/c3ref/close.html)
sqlite3_close(mDb); mDb = NULL ;
} }
void RetroDb::closeDb(){ void RetroDb::closeDb(){
int rc; int rc= sqlite3_close(mDb);
mDb = NULL ;
if(mDb)
rc = sqlite3_close(mDb);
#ifdef RETRODB_DEBUG #ifdef RETRODB_DEBUG
std::cerr << "RetroDb::closeDb(): Error code on close: " << rc << std::endl; std::cerr << "RetroDb::closeDb(): Error code on close: " << rc << std::endl;