diff options
author | rubidium <rubidium@openttd.org> | 2007-06-27 17:19:05 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-06-27 17:19:05 +0000 |
commit | 926d103482b92bb345f27d0e773f3289803ad6bd (patch) | |
tree | b0d20222e199028e6c7ebc3a16cb76e98d6ef1b4 | |
parent | 0ab80d824b9f1935871eb165961900c368216ad3 (diff) | |
download | openttd-926d103482b92bb345f27d0e773f3289803ad6bd.tar.xz |
(svn r10358) -Codechange: remove the cargopacket leakchecker as it never asserted in almost a week of stresstesting, so I'm pretty sure all cornercases are tested by now.
-rw-r--r-- | src/blitter/factory.hpp | 1 | ||||
-rw-r--r-- | src/cargopacket.h | 2 | ||||
-rw-r--r-- | src/openttd.cpp | 26 |
3 files changed, 1 insertions, 28 deletions
diff --git a/src/blitter/factory.hpp b/src/blitter/factory.hpp index a55250071..8f289c2ce 100644 --- a/src/blitter/factory.hpp +++ b/src/blitter/factory.hpp @@ -64,6 +64,7 @@ public: BlitterFactoryBase *b = (*it).second; if (strcasecmp(name, b->name) == 0) { Blitter *newb = b->CreateInstance(); + delete *GetActiveBlitter(); *GetActiveBlitter() = newb; return newb; } diff --git a/src/cargopacket.h b/src/cargopacket.h index fab8418d5..0ba54fa2c 100644 --- a/src/cargopacket.h +++ b/src/cargopacket.h @@ -11,8 +11,6 @@ * Container for cargo from the same location and time */ struct CargoPacket { - bool touched; - typedef uint32 ID; ///< Type for cargopacket identifiers ID index; ///< The unique index of this packet diff --git a/src/openttd.cpp b/src/openttd.cpp index b05324862..e0060321b 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -938,31 +938,6 @@ void SwitchMode(int new_mode) } } -#include "cargopacket.h" -void CheckCargoPacketLeaks() -{ - CargoPacket *cp; - FOR_ALL_CARGOPACKETS(cp) cp->touched = false; - - Vehicle *v; - FOR_ALL_VEHICLES(v) { - const CargoList::List *packets = v->cargo.Packets(); - for (CargoList::List::const_iterator it = packets->begin(); it != packets->end(); it++) (*it)->touched = true; - } - - Station *st; - FOR_ALL_STATIONS(st) { - for (CargoID c = 0; c < NUM_CARGO; c++) { - GoodsEntry *ge = &st->goods[c]; - - const CargoList::List *packets = ge->cargo.Packets(); - for (CargoList::List::const_iterator it = packets->begin(); it != packets->end(); it++) (*it)->touched = true; - } - } - - FOR_ALL_CARGOPACKETS(cp) assert(cp->touched); -} - /* State controlling game loop. * The state must not be changed from anywhere @@ -997,7 +972,6 @@ void StateGameLoop() CallWindowTickEvent(); NewsLoop(); _current_player = p; - CheckCargoPacketLeaks(); } } |