Changeset - r17787:f659177af324
[Not reviewed]
master
0 1 0
michi_cc - 13 years ago 2011-06-13 10:46:00
michi_cc@openttd.org
(svn r22582) -Fix: Don't increment STL iterators after they've been invalidated.
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/cargopacket.cpp
Show inline comments
 
@@ -218,7 +218,7 @@ void CargoList<Tinst>::Truncate(uint max
 
		CargoPacket *cp = *it;
 
		if (max_remaining == 0) {
 
			/* Nothing should remain, just remove the packets. */
 
			this->packets.erase(it++);
 
			it = this->packets.erase(it);
 
			static_cast<Tinst *>(this)->RemoveFromCache(cp);
 
			delete cp;
 
			continue;
 
@@ -278,7 +278,7 @@ bool CargoList<Tinst>::MoveTo(Tother_ins
 
		if (cp->count <= max_move) {
 
			/* Can move the complete packet */
 
			max_move -= cp->count;
 
			this->packets.erase(it++);
 
			it = this->packets.erase(it);
 
			static_cast<Tinst *>(this)->RemoveFromCache(cp);
 
			switch (mta) {
 
				case MTA_FINAL_DELIVERY:
0 comments (0 inline, 0 general)