Vector.erase(Iterator) causes bad memory access

前端 未结 4 638
借酒劲吻你
借酒劲吻你 2020-12-03 19:49

I am trying to do a Z-Index reordering of videoObjects stored in a vector. The plan is to identify the videoObject which is going to b

4条回答
  •  旧时难觅i
    2020-12-03 20:01

    You cannot delete while iterating over the list because the iterator gets invalid. You should use the return iterator of Erase to set it to your current iterator.

提交回复
热议问题