changeset 7091:fcc7fb10869f draft

(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.
author rubidium <rubidium@openttd.org>
date Wed, 27 Jun 2007 17:19:05 +0000
parents b0933d2ad8e9
children 8a4705238c4a
files src/blitter/factory.hpp src/cargopacket.h src/openttd.cpp
diffstat 3 files changed, 1 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/src/blitter/factory.hpp
+++ b/src/blitter/factory.hpp
@@ -64,6 +64,7 @@
 			BlitterFactoryBase *b = (*it).second;
 			if (strcasecmp(name, b->name) == 0) {
 				Blitter *newb = b->CreateInstance();
+				delete *GetActiveBlitter();
 				*GetActiveBlitter() = newb;
 				return newb;
 			}
--- 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
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -938,31 +938,6 @@
 	}
 }
 
-#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 @@
 		CallWindowTickEvent();
 		NewsLoop();
 		_current_player = p;
-		CheckCargoPacketLeaks();
 	}
 }