Fix the memory leak in table index

Summary:

BinarySearchIndex didn't use unique_ptr to guard the block object nor
delete it in destructor, leading to valgrind failure for "definite
memory leak".

Test Plan:
re-ran the failed valgrind test cases
main
Kai Liu 11 years ago
parent ff151132b3
commit 16d4e45c12
  1. 2
      table/block_based_table_reader.cc

@ -181,7 +181,7 @@ class BinarySearchIndexReader : public IndexReader {
: IndexReader(comparator), index_block_(index_block) {
assert(index_block_ != nullptr);
}
Block* index_block_;
std::unique_ptr<Block> index_block_;
};
// TODO(kailiu) This class is only a stub for now. And the comment below is also

Loading…
Cancel
Save