diff options
-rw-r--r-- | datastore-leveldb/src/db.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/datastore-leveldb/src/db.cpp b/datastore-leveldb/src/db.cpp index aae378f..a952512 100644 --- a/datastore-leveldb/src/db.cpp +++ b/datastore-leveldb/src/db.cpp @@ -46,10 +46,13 @@ leveldb::DB *getDB(std::string& name) { void closeDB() { - for (auto it = dbs.begin(); it != dbs.end(); ++it) { - std::cout << "Close " << (*it).first << std::endl; + std::cout << "Close Databases: "; + auto it = dbs.begin(); + while (it != dbs.end()) { + std::cout << (*it).first << ". "; delete (*it).second; - dbs.erase(it); + dbs.erase(it++); //post increment! } + std::cout << std::endl; } |