From 19cc588b778826415db15f6336a5619897a69a73 Mon Sep 17 00:00:00 2001 From: wankai Date: Thu, 4 Sep 2014 00:44:49 +0800 Subject: [PATCH] change to filter_block std::unique_ptr support RAII --- table/block_based_table_builder.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/table/block_based_table_builder.cc b/table/block_based_table_builder.cc index 5d0fc9988..ddfbe74a6 100644 --- a/table/block_based_table_builder.cc +++ b/table/block_based_table_builder.cc @@ -401,7 +401,7 @@ struct BlockBasedTableBuilder::Rep { TableProperties props; bool closed = false; // Either Finish() or Abandon() has been called. - FilterBlockBuilder* filter_block; + std::unique_ptr filter_block; char compressed_cache_key_prefix[BlockBasedTable::kMaxCacheKeyPrefixSize]; size_t compressed_cache_key_prefix_size; @@ -461,7 +461,6 @@ BlockBasedTableBuilder::BlockBasedTableBuilder( BlockBasedTableBuilder::~BlockBasedTableBuilder() { assert(rep_->closed); // Catch errors where caller forgot to call Finish() - delete rep_->filter_block; delete rep_; }