diff --git a/examples/wayland/qwindow-compositor/compositor.cpp b/examples/wayland/qwindow-compositor/compositor.cpp
index 065a6bfaea69094fd430b32dfedcd4acd64c4436..c60ecc6b51f0a2c4b5f22e5d58e3566b660c9d34 100644
--- a/examples/wayland/qwindow-compositor/compositor.cpp
+++ b/examples/wayland/qwindow-compositor/compositor.cpp
@@ -456,8 +456,10 @@ void Compositor::handleDrag(View *target, QMouseEvent *me)
     }
     QWaylandDrag *currentDrag = defaultInputDevice()->drag();
     currentDrag->dragMove(surface, pos);
-    if (me->buttons() == Qt::NoButton)
+    if (me->buttons() == Qt::NoButton) {
+        m_views.removeOne(findView(currentDrag->icon()));
         currentDrag->drop();
+    }
 }
 
 // We only have a flat list of views, plus pointers from child to parent,