@Mingun: this is an std::list. Only iterators to erased elements are invalidated. mPackages.erase(it++); is perfectly fine.