This commit is contained in:
Elena.Subbotina
2023-02-21 12:22:15 +03:00
parent 698def3934
commit ecd2a5eba1

View File

@ -160,19 +160,17 @@ const bool BinReaderProcessor::readChild(BaseObject& object, const bool is_manda
// We don't update ret_val here because we are reading to the copy of the object. // We don't update ret_val here because we are reading to the copy of the object.
// And the real object will remain uninitialized // And the real object will remain uninitialized
wanted_objects.push_back(object.clone()); // store the copy of the object that was not found (this line is here to take another chance to be read after some trash processed) wanted_objects.push_back(object.clone()); // store the copy of the object that was not found (this line is here to take another chance to be read after some trash processed)
for(BaseObjectPtrList::iterator it = wanted_objects.begin()/*, itEnd = */; for (BaseObjectPtrList::iterator it = wanted_objects.begin(); it != wanted_objects.end();)
it != wanted_objects.end();)
{ {
const BaseObjectPtr w_object = *it; const BaseObjectPtr w_object = *it;
if(w_object->read(reader_, parent_, false)) BaseObjectPtrList::iterator it_del = wanted_objects.end();
if (w_object->read(reader_, parent_, false))
{ {
// Remove successfully read object from the wanted objects list it_del = it;
wanted_objects.erase(++it);
}
else
{
++it;
} }
++it;
if (it_del != wanted_objects.end())
wanted_objects.erase(it_del);
} }
} }
} }