From 679efe2ff345836a4481ae2cde2603ad8c6ef766 Mon Sep 17 00:00:00 2001 From: csoler Date: Sat, 5 Apr 2014 15:30:48 +0000 Subject: [PATCH] fixed double call to sqlite3_close() git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7237 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/util/retrodb.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libretroshare/src/util/retrodb.cc b/libretroshare/src/util/retrodb.cc index 967b1f98f..9ffcf857b 100644 --- a/libretroshare/src/util/retrodb.cc +++ b/libretroshare/src/util/retrodb.cc @@ -72,16 +72,14 @@ RetroDb::RetroDb(const std::string &dbPath, int flags, const std::string& key) : RetroDb::~RetroDb(){ - if(mDb) - sqlite3_close(mDb); + sqlite3_close(mDb); // no-op if mDb is NULL (https://www.sqlite.org/c3ref/close.html) + mDb = NULL ; } void RetroDb::closeDb(){ - int rc; - - if(mDb) - rc = sqlite3_close(mDb); + int rc= sqlite3_close(mDb); + mDb = NULL ; #ifdef RETRODB_DEBUG std::cerr << "RetroDb::closeDb(): Error code on close: " << rc << std::endl;