Memtables should be deleted appropriately in the unit test.

Summary:
Memtables should be deleted appropriately in the unit test.

Test Plan:

Reviewers:

CC:

Task ID: #

Blame Rev:
main
Dhruba Borthakur 11 years ago
parent 45a2f2d8d3
commit 96bc3ec297
  1. 2
      db/write_batch_test.cc
  2. 6
      table/table_test.cc

@ -69,7 +69,7 @@ static std::string PrintContents(WriteBatch* b) {
} else if (count != WriteBatchInternal::Count(b)) {
state.append("CountMismatch()");
}
mem->Unref();
delete mem->Unref();
return state;
}

@ -374,10 +374,10 @@ class MemTableConstructor: public Constructor {
memtable_->Ref();
}
~MemTableConstructor() {
memtable_->Unref();
delete memtable_->Unref();
}
virtual Status FinishImpl(const Options& options, const KVMap& data) {
memtable_->Unref();
delete memtable_->Unref();
memtable_ = new MemTable(internal_comparator_, table_factory_);
memtable_->Ref();
int seq = 1;
@ -1289,7 +1289,7 @@ TEST(MemTableTest, Simple) {
}
delete iter;
memtable->Unref();
delete memtable->Unref();
}

Loading…
Cancel
Save