It's dangerous here, since you are erasing object when iterating the Vector.
Solution:
Using another std::vector<> to save the objects to be removed, iterating that vector and remove them.