mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
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:
@@ -181,7 +181,7 @@ class BinarySearchIndexReader : public IndexReader {
|
|||||||
: IndexReader(comparator), index_block_(index_block) {
|
: IndexReader(comparator), index_block_(index_block) {
|
||||||
assert(index_block_ != nullptr);
|
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
|
// TODO(kailiu) This class is only a stub for now. And the comment below is also
|
||||||
|
|||||||
Reference in New Issue
Block a user