diff --git a/src/cargopacket.cpp b/src/cargopacket.cpp --- a/src/cargopacket.cpp +++ b/src/cargopacket.cpp @@ -155,6 +155,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. * @param cp Packet to be removed from cache.