关于vector删除sprite

我目前的程序需要干着这么一件事情:
在schedule里每隔0.5s往一个vector里添加一个sprite,并且让这个sprite往下移动,当这个sprite出屏幕以后就没用了,可以移除他了。
现在我的做法是开一个线程,线程里无限循环,每一次循环都遍历这个vector中的每个sprite并看他的positionY是不是出屏幕,是的话把他赋值给一个Sprite,然后在遍历的外面删掉,代码如下:
void Main::threadCheckPositionY()
{
while (true)
{
std::this_thread::sleep_for(std::chrono::microseconds(10));
Sprite* obj=nullptr;
for (auto stage : stages)
{
if (stage->getPositionY() < 0){
obj = stage;
}
if (stage->getPositionY() + stage->getContentSize().height / 2 <= ball->getPositionY() - ball->getContentSize().height / 2)
stage->getPhysicsBody()->setCategoryBitmask(0x0005);
}
if (obj != nullptr)
{
stages.eraseObject(obj);
removeChild(obj);
}
}
}

第一个问题是,在vector里删精灵,需要按着我这样先把vector里面的删了,然后再调用removeChild吗?
第二个问题是,我目前这么做程序时不时就会崩溃,报的错是说iterator not incrementable,有没有什么解决办法?
多谢大家了。