From a329dd1b25a43264691ac281667de792f7987a95 Mon Sep 17 00:00:00 2001 From: Igor Canadi Date: Wed, 5 Mar 2014 12:27:39 -0800 Subject: [PATCH] Fix TEST_Destroy_DBImpl() to work with column families --- db/db_impl.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/db/db_impl.cc b/db/db_impl.cc index 49e3e28302..014c2fb20e 100644 --- a/db/db_impl.cc +++ b/db/db_impl.cc @@ -361,6 +361,10 @@ void DBImpl::TEST_Destroy_DBImpl() { bg_compaction_scheduled_ += LargeNumber; mutex_.Unlock(); + if (default_cf_handle_ != nullptr) { + // we need to delete handle outside of lock because it does its own locking + delete default_cf_handle_; + } LogFlush(options_.info_log); // force release the lock file. @@ -369,7 +373,9 @@ void DBImpl::TEST_Destroy_DBImpl() { } log_.reset(); + mutex_.Lock(); versions_.reset(); + mutex_.Unlock(); table_cache_.reset(); }