File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -218,16 +218,16 @@ void RocksdbDB::Init() {
218218}
219219
220220void RocksdbDB::Cleanup () {
221+ const std::lock_guard<std::mutex> lock (mu_);
222+ if (--ref_cnt_) {
223+ return ;
224+ }
221225 for (size_t i = 0 ; i < cf_handles_.size (); i++) {
222226 if (cf_handles_[i] != nullptr ) {
223227 delete cf_handles_[i];
224228 cf_handles_[i] = nullptr ;
225229 }
226230 }
227- const std::lock_guard<std::mutex> lock (mu_);
228- if (--ref_cnt_) {
229- return ;
230- }
231231 delete db_;
232232}
233233
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ class RocksdbDB : public DB {
9292
9393 int fieldcount_;
9494
95- std::vector<rocksdb::ColumnFamilyHandle *> cf_handles_;
95+ static std::vector<rocksdb::ColumnFamilyHandle *> cf_handles_;
9696 static rocksdb::DB *db_;
9797 static int ref_cnt_;
9898 static std::mutex mu_;
You can’t perform that action at this time.
0 commit comments