diff --git a/src/newgrf.cpp b/src/newgrf.cpp index 708fc547de..d445c104ae 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -5825,6 +5825,7 @@ static void NewSpriteGroup(ByteReader *buf) ProcessDeterministicSpriteGroupRanges(ranges, group->ranges, group->default_group); OptimiseVarAction2DeterministicSpriteGroup(va2_opt_state, feature, varsize, group, current_adjusts); + current_adjusts.clear(); break; } diff --git a/src/newgrf_internal.h b/src/newgrf_internal.h index effc059a70..d9322bc9e7 100644 --- a/src/newgrf_internal.h +++ b/src/newgrf_internal.h @@ -129,6 +129,9 @@ public: this->group_temp_store_variable_tracking_storage.EmptyArena(); this->procedure_annotations.clear(); this->procedure_annotations_storage.EmptyArena(); + for (auto iter : this->inlinable_adjust_groups) { + iter.second->~vector(); + } this->inlinable_adjust_groups.clear(); this->inlinable_adjust_groups_storage.EmptyArena(); this->dead_store_elimination_candidates.clear();