diff --git a/src/server/subcompositor_interface.cpp b/src/server/subcompositor_interface.cpp --- a/src/server/subcompositor_interface.cpp +++ b/src/server/subcompositor_interface.cpp @@ -177,7 +177,7 @@ surface->d_func()->subSurfacePending.slideIsSet = false; parent->d_func()->addChild(QPointer(q)); - QObject::connect(surface, &QObject::destroyed, q, + QObject::connect(surface.data(), &QObject::destroyed, q, [this] { // from spec: "If the wl_surface associated with the wl_subsurface is destroyed, // the wl_subsurface object becomes inert. Note, that destroying either object