Skip to content

Commit

Permalink
Memtables should be deleted appropriately in the unit test.
Browse files Browse the repository at this point in the history
Summary:
Memtables should be deleted appropriately in the unit test.

Test Plan:

Reviewers:

CC:

Task ID: #

Blame Rev:
  • Loading branch information
dhruba committed Dec 2, 2013
1 parent 45a2f2d commit 96bc3ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion db/write_batch_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
6 changes: 3 additions & 3 deletions table/table_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -1289,7 +1289,7 @@ TEST(MemTableTest, Simple) {
}

delete iter;
memtable->Unref();
delete memtable->Unref();
}


Expand Down

0 comments on commit 96bc3ec

Please sign in to comment.