Skip to content

Commit 96bc3ec

Browse files
committed
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:
1 parent 45a2f2d commit 96bc3ec

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

db/write_batch_test.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ static std::string PrintContents(WriteBatch* b) {
6969
} else if (count != WriteBatchInternal::Count(b)) {
7070
state.append("CountMismatch()");
7171
}
72-
mem->Unref();
72+
delete mem->Unref();
7373
return state;
7474
}
7575

table/table_test.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -374,10 +374,10 @@ class MemTableConstructor: public Constructor {
374374
memtable_->Ref();
375375
}
376376
~MemTableConstructor() {
377-
memtable_->Unref();
377+
delete memtable_->Unref();
378378
}
379379
virtual Status FinishImpl(const Options& options, const KVMap& data) {
380-
memtable_->Unref();
380+
delete memtable_->Unref();
381381
memtable_ = new MemTable(internal_comparator_, table_factory_);
382382
memtable_->Ref();
383383
int seq = 1;
@@ -1289,7 +1289,7 @@ TEST(MemTableTest, Simple) {
12891289
}
12901290

12911291
delete iter;
1292-
memtable->Unref();
1292+
delete memtable->Unref();
12931293
}
12941294

12951295

0 commit comments

Comments
 (0)