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
This commit is contained in:
Kai Liu 2014-03-01 11:50:35 -08:00
parent ff151132b3
commit 16d4e45c12

View File

@ -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