Fix invalid iterator in SurfaceInterfacePrivate::raiseChild()

The append method will invalidate the iterator, so we cannot call the
erase() method with the old iterator.
This commit is contained in:
Vlad Zahorodnii 2021-05-13 10:14:22 +03:00
parent 89dc01ada8
commit d740a45469

View file

@ -110,8 +110,8 @@ bool SurfaceInterfacePrivate::raiseChild(SubSurfaceInterface *subsurface, Surfac
}
if (sibling == q) {
// it's to the parent, so needs to become last item
pending.children.append(*it);
pending.children.erase(it);
pending.children.append(subsurface);
pending.childrenChanged = true;
return true;
}