diff --git a/src/economy.cpp b/src/economy.cpp index 52977aff3c..e8fcddbaf2 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -1192,7 +1192,7 @@ CargoPayment::CargoPayment(Vehicle *front) : CargoPayment::~CargoPayment() { - if (this->CleaningPool()) return; + if (CleaningPool()) return; this->front->cargo_payment = nullptr; diff --git a/src/roadstop.cpp b/src/roadstop.cpp index cd9a3b1152..fa89cd4ce9 100644 --- a/src/roadstop.cpp +++ b/src/roadstop.cpp @@ -30,8 +30,6 @@ RoadStop::~RoadStop() if (this->status.Test(RoadStopStatusFlag::BaseEntry)) { delete this->entries; } - - if (CleaningPool()) return; } /** diff --git a/src/story.cpp b/src/story.cpp index 89a2474811..18af96767e 100644 --- a/src/story.cpp +++ b/src/story.cpp @@ -39,10 +39,10 @@ INSTANTIATE_POOL_METHODS(StoryPage) StoryPage::~StoryPage() { - if (!this->CleaningPool()) { - for (StoryPageElement *spe : StoryPageElement::Iterate()) { - if (spe->page == this->index) delete spe; - } + if (CleaningPool()) return; + + for (StoryPageElement *spe : StoryPageElement::Iterate()) { + if (spe->page == this->index) delete spe; } }