# HG changeset patch # User KUDr # Date 1169222503 0 # Node ID e7a55ca9e43dafa35e2ffc15099aec201292b19f # Parent fbef81292ff9550969caf569fc8a042e8f488634 (svn r8277) -Fix (r8038): assert on game exit when waypoints were used. The static variable of type Station (inside ComposeWaypointStation) replaced by byte array so no destructor is called for it on exit. diff -r fbef81292ff9 -r e7a55ca9e43d src/waypoint.cpp --- a/src/waypoint.cpp Fri Jan 19 11:47:48 2007 +0000 +++ b/src/waypoint.cpp Fri Jan 19 16:01:43 2007 +0000 @@ -353,7 +353,11 @@ Station *ComposeWaypointStation(TileIndex tile) { Waypoint *wp = GetWaypointByTile(tile); - static Station stat; + + /* instead of 'static Station stat' use byte array to avoid Station's destructor call upon exit. As + * a side effect, the station is not constructed now. */ + static byte stat_raw[sizeof Station]; + static Station &stat = *(Station*)stat_raw; stat.train_tile = stat.xy = wp->xy; stat.town = GetTown(wp->town_index);