Merge pull request #260 from wankai/master

replace filter_block with std::unique_ptr to support RAII
This commit is contained in:
Igor Canadi 2014-09-03 10:13:16 -07:00
commit 4b5ad88658

View File

@ -401,7 +401,7 @@ struct BlockBasedTableBuilder::Rep {
TableProperties props; TableProperties props;
bool closed = false; // Either Finish() or Abandon() has been called. 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]; char compressed_cache_key_prefix[BlockBasedTable::kMaxCacheKeyPrefixSize];
size_t compressed_cache_key_prefix_size; size_t compressed_cache_key_prefix_size;
@ -461,7 +461,6 @@ BlockBasedTableBuilder::BlockBasedTableBuilder(
BlockBasedTableBuilder::~BlockBasedTableBuilder() { BlockBasedTableBuilder::~BlockBasedTableBuilder() {
assert(rep_->closed); // Catch errors where caller forgot to call Finish() assert(rep_->closed); // Catch errors where caller forgot to call Finish()
delete rep_->filter_block;
delete rep_; delete rep_;
} }