better:

for (std::vector<...>::iter = map.begin(); iter != map.end();) {
  if (...) {
    delete it->second;
    iter = map.erase(iter);
  } else {
    ++iter;
  }
}