From 3907c94ffb734825de33449b245ae668990e5070 Mon Sep 17 00:00:00 2001 From: Yi Wu Date: Wed, 10 May 2017 22:46:24 -0700 Subject: [PATCH] Fix ColumnFamilyTest:BulkAddDrop Summary: Fix ColumnFamilyTest:BulkAddDrop not deleted CF handles at the end, causing ASAN failure. Closes https://github.com/facebook/rocksdb/pull/2275 Differential Revision: D5040724 Pulled By: yiwu-arbug fbshipit-source-id: 86cd4070c944d01173a3cc36462bb800698af192 --- db/column_family_test.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/db/column_family_test.cc b/db/column_family_test.cc index 10c0c0d35..7ebe0068b 100644 --- a/db/column_family_test.cc +++ b/db/column_family_test.cc @@ -692,6 +692,9 @@ TEST_F(ColumnFamilyTest, BulkAddDrop) { } ASSERT_OK(db_->DropColumnFamilies(cf_handles)); std::vector cf_descriptors; + for (auto* handle : cf_handles) { + delete handle; + } cf_handles.clear(); for (int i = 1; i <= kNumCF; i++) { cf_descriptors.emplace_back("cf2-" + ToString(i), ColumnFamilyOptions()); @@ -701,6 +704,9 @@ TEST_F(ColumnFamilyTest, BulkAddDrop) { ASSERT_OK(db_->Put(write_options, cf_handles[i - 1], "foo", "bar")); } ASSERT_OK(db_->DropColumnFamilies(cf_handles)); + for (auto* handle : cf_handles) { + delete handle; + } Close(); std::vector families; ASSERT_OK(DB::ListColumnFamilies(db_options_, dbname_, &families));