summaryrefslogtreecommitdiff
path: root/src/waypoint.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/waypoint.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/waypoint.cpp')
-rw-r--r--src/waypoint.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/waypoint.cpp b/src/waypoint.cpp
index 425c7a503..9847c9870 100644
--- a/src/waypoint.cpp
+++ b/src/waypoint.cpp
@@ -404,17 +404,14 @@ Waypoint::Waypoint(TileIndex tile)
Waypoint::~Waypoint()
{
+ if (this->string != STR_NULL) DeleteName(this->string);
+
+ if (CleaningPool()) return;
+
RemoveOrderFromAllVehicles(OT_GOTO_WAYPOINT, this->index);
RedrawWaypointSign(this);
this->xy = 0;
-
- this->QuickFree();
-}
-
-void Waypoint::QuickFree()
-{
- if (this->string != STR_NULL) DeleteName(this->string);
}
bool Waypoint::IsValid() const