From d740a45469672b1fa485549cabbe9accd4a88877 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Thu, 13 May 2021 10:14:22 +0300 Subject: [PATCH] Fix invalid iterator in SurfaceInterfacePrivate::raiseChild() The append method will invalidate the iterator, so we cannot call the erase() method with the old iterator. --- src/wayland/surface_interface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wayland/surface_interface.cpp b/src/wayland/surface_interface.cpp index a4908e3fc7..c6eca61d0f 100644 --- a/src/wayland/surface_interface.cpp +++ b/src/wayland/surface_interface.cpp @@ -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; }