Skip to content

Commit

Permalink
Merge pull request XRPLF#260 from wankai/master
Browse files Browse the repository at this point in the history
replace filter_block with std::unique_ptr to support RAII
  • Loading branch information
igorcanadi committed Sep 3, 2014
2 parents 9b976e3 + 19cc588 commit 4b5ad88
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions table/block_based_table_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<FilterBlockBuilder> filter_block;
char compressed_cache_key_prefix[BlockBasedTable::kMaxCacheKeyPrefixSize];
size_t compressed_cache_key_prefix_size;

Expand Down Expand Up @@ -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_;
}

Expand Down

0 comments on commit 4b5ad88

Please sign in to comment.