diff --git a/db/prefix_test.cc b/db/prefix_test.cc index 66cef92cb..ca00c31b3 100644 --- a/db/prefix_test.cc +++ b/db/prefix_test.cc @@ -108,7 +108,6 @@ class PrefixTest { options.min_write_buffer_number_to_merge = FLAGS_min_write_buffer_number_to_merge; - options.comparator = new TestKeyComparator(); options.memtable_prefix_bloom_bits = FLAGS_memtable_prefix_bloom_bits; options.memtable_prefix_bloom_probes = FLAGS_memtable_prefix_bloom_probes; @@ -142,7 +141,9 @@ class PrefixTest { return false; } - PrefixTest() : option_config_(kBegin) { } + PrefixTest() : option_config_(kBegin) { + options.comparator = new TestKeyComparator(); + } ~PrefixTest() { delete options.comparator; } diff --git a/util/hash_linklist_rep.cc b/util/hash_linklist_rep.cc index e53bffbb6..214ac2c55 100644 --- a/util/hash_linklist_rep.cc +++ b/util/hash_linklist_rep.cc @@ -125,7 +125,7 @@ class HashLinkListRep : public MemTableRep { class FullListIterator : public MemTableRep::Iterator { public: explicit FullListIterator(FullList* list) - : iter_(list) {} + : iter_(list), full_list_(list) {} virtual ~FullListIterator() { } @@ -177,6 +177,8 @@ class HashLinkListRep : public MemTableRep { } private: FullList::Iterator iter_; + // To destruct with the iterator. + std::unique_ptr full_list_; std::string tmp_; // For passing to EncodeKey };