summaryrefslogtreecommitdiff
path: root/src/station.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-08-05 21:20:55 +0000
committerrubidium <rubidium@openttd.org>2007-08-05 21:20:55 +0000
commit8f719a7b2d8de79d8f456ef30ddde5f30100f18a (patch)
treebfe043c51f23052fc39f35769a2ede1e66998148 /src/station.cpp
parentdfe851e02f21c002607ddd9bdf12f145a5ed070c (diff)
downloadopenttd-8f719a7b2d8de79d8f456ef30ddde5f30100f18a.tar.xz
(svn r10799) -Fix: only calling QuickFree and not the destructor on pool cleanups might cause memory leaks due to the way C++ works.
Diffstat (limited to 'src/station.cpp')
-rw-r--r--src/station.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/station.cpp b/src/station.cpp
index 4633f1d18..150719e8f 100644
--- a/src/station.cpp
+++ b/src/station.cpp
@@ -64,6 +64,11 @@ Station::~Station()
{
DEBUG(station, cDebugCtorLevel, "I-%3d", index);
+ DeleteName(this->string_id);
+ free(this->speclist);
+
+ if (CleaningPool()) return;
+
MarkDirty();
RebuildStationLists();
InvalidateWindowClasses(WC_STATION_LIST);
@@ -81,14 +86,6 @@ Station::~Station()
for (CargoID c = 0; c < NUM_CARGO; c++) {
goods[c].cargo.Truncate(0);
}
-
- this->QuickFree();
-}
-
-void Station::QuickFree()
-{
- DeleteName(this->string_id);
- free(this->speclist);
}
/** Called when new facility is built on the station. If it is the first facility