Mercurial > hg > openttd
changeset 17797:e62973043805 draft
(svn r22582) -Fix: Don't increment STL iterators after they've been invalidated.
author | michi_cc <michi_cc@openttd.org> |
---|---|
date | Mon, 13 Jun 2011 10:46:00 +0000 |
parents | a5a8fa479f8c |
children | 4581fc7adab8 |
files | src/cargopacket.cpp |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/cargopacket.cpp +++ b/src/cargopacket.cpp @@ -218,7 +218,7 @@ 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 @@ 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: