提交 f653fdcf 编写于 作者: I Igor Canadi

Fixing iterator cleanup for Tailing iterator

Immutable tailing iterator doesn't set CleanupState::mem, so we don't
have to unref it.
上级 b13bdfa5
......@@ -2668,9 +2668,11 @@ static void CleanupIteratorState(void* arg1, void* arg2) {
DBImpl::DeletionState deletion_state(state->db->GetOptions().
max_write_buffer_number);
state->mu->Lock();
MemTable* m = state->mem->Unref();
if (m != nullptr) {
deletion_state.memtables_to_free.push_back(m);
if (state->mem) { // not set for immutable iterator
MemTable* m = state->mem->Unref();
if (m != nullptr) {
deletion_state.memtables_to_free.push_back(m);
}
}
if (state->version) { // not set for memtable-only iterator
state->version->Unref();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册