# HG changeset patch # User michi_cc # Date 2011-06-13 10:46:00 # Node ID f659177af32409e16d282a8c68db14f94100dc2c # Parent d6324eee7a1d5dcb520280fe11f9ec47efe9d2ce (svn r22582) -Fix: Don't increment STL iterators after they've been invalidated. diff --git a/src/cargopacket.cpp b/src/cargopacket.cpp --- a/src/cargopacket.cpp +++ b/src/cargopacket.cpp @@ -218,7 +218,7 @@ void CargoList::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(this)->RemoveFromCache(cp); delete cp; continue; @@ -278,7 +278,7 @@ bool CargoList::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(this)->RemoveFromCache(cp); switch (mta) { case MTA_FINAL_DELIVERY: