|
|
@ -2673,9 +2673,11 @@ static void CleanupIteratorState(void* arg1, void* arg2) { |
|
|
|
DBImpl::DeletionState deletion_state(state->db->GetOptions(). |
|
|
|
DBImpl::DeletionState deletion_state(state->db->GetOptions(). |
|
|
|
max_write_buffer_number); |
|
|
|
max_write_buffer_number); |
|
|
|
state->mu->Lock(); |
|
|
|
state->mu->Lock(); |
|
|
|
MemTable* m = state->mem->Unref(); |
|
|
|
if (state->mem) { // not set for immutable iterator
|
|
|
|
if (m != nullptr) { |
|
|
|
MemTable* m = state->mem->Unref(); |
|
|
|
deletion_state.memtables_to_free.push_back(m); |
|
|
|
if (m != nullptr) { |
|
|
|
|
|
|
|
deletion_state.memtables_to_free.push_back(m); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (state->version) { // not set for memtable-only iterator
|
|
|
|
if (state->version) { // not set for memtable-only iterator
|
|
|
|
state->version->Unref(); |
|
|
|
state->version->Unref(); |
|
|
|