From 68bc93f95074702fde2876904198f585969201cc Mon Sep 17 00:00:00 2001 From: rubidium Date: Sat, 19 Feb 2011 18:02:17 +0000 Subject: (svn r22111) -Codechange/fix-ish: upon cleaning a pool a destructor should not delete items from other pools --- src/cargopacket.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/cargopacket.cpp') diff --git a/src/cargopacket.cpp b/src/cargopacket.cpp index f7d4348f9..012ae78f5 100644 --- a/src/cargopacket.cpp +++ b/src/cargopacket.cpp @@ -154,6 +154,16 @@ CargoList::~CargoList() } } +/** + * Empty the cargo list, but don't free the cargo packets; + * the cargo packets are cleaned by CargoPacket's CleanPool. + */ +template +void CargoList::OnCleanPool() +{ + this->packets.clear(); +} + /** * Update the cached values to reflect the removal of this packet. * Decreases count and days_in_transit. -- cgit v1.2.3-70-g09d2