| 777 | } |
| 778 | |
| 779 | void DBImpl::CleanupCompaction(CompactionState* compact) { |
| 780 | mutex_.AssertHeld(); |
| 781 | if (compact->builder != nullptr) { |
| 782 | // May happen if we get a shutdown call in the middle of compaction |
| 783 | compact->builder->Abandon(); |
| 784 | delete compact->builder; |
| 785 | } else { |
| 786 | assert(compact->outfile == nullptr); |
| 787 | } |
| 788 | delete compact->outfile; |
| 789 | for (size_t i = 0; i < compact->outputs.size(); i++) { |
| 790 | const CompactionState::Output& out = compact->outputs[i]; |
| 791 | pending_outputs_.erase(out.number); |
| 792 | } |
| 793 | delete compact; |
| 794 | } |
| 795 | |
| 796 | Status DBImpl::OpenCompactionOutputFile(CompactionState* compact) { |
| 797 | assert(compact != nullptr); |