Properly break circular reference if a job gets cancelled while working

This commit is contained in:
Relintai 2020-10-24 22:04:57 +02:00
parent 0f5158edeb
commit b069d38265

View File

@ -78,6 +78,10 @@ void VoxelJob::_execute() {
while (!get_cancelled() && _in_tree && !_build_done && origpt == _build_phase_type && !should_return()) { while (!get_cancelled() && _in_tree && !_build_done && origpt == _build_phase_type && !should_return()) {
execute_phase(); execute_phase();
} }
if (!_in_tree) {
_chunk.unref();
}
} }
void VoxelJob::execute_phase() { void VoxelJob::execute_phase() {