diff --git a/autotests/integration/kwin_wayland_test.h b/autotests/integration/kwin_wayland_test.h index d5c4861859..87a048f12c 100644 --- a/autotests/integration/kwin_wayland_test.h +++ b/autotests/integration/kwin_wayland_test.h @@ -679,8 +679,8 @@ void flushWaylandConnection(); bool waylandSync(); std::unique_ptr createSurface(); -KWayland::Client::SubSurface *createSubSurface(KWayland::Client::Surface *surface, - KWayland::Client::Surface *parentSurface, QObject *parent = nullptr); +std::unique_ptr createSubSurface(KWayland::Client::Surface *surface, + KWayland::Client::Surface *parentSurface); std::unique_ptr createLayerSurfaceV1(KWayland::Client::Surface *surface, const QString &scope, diff --git a/autotests/integration/test_helpers.cpp b/autotests/integration/test_helpers.cpp index 8b27f3e080..3c598ca9df 100644 --- a/autotests/integration/test_helpers.cpp +++ b/autotests/integration/test_helpers.cpp @@ -905,14 +905,13 @@ std::unique_ptr createSurface() return s->isValid() ? std::move(s) : nullptr; } -KWayland::Client::SubSurface *createSubSurface(KWayland::Client::Surface *surface, KWayland::Client::Surface *parentSurface, QObject *parent) +std::unique_ptr createSubSurface(KWayland::Client::Surface *surface, KWayland::Client::Surface *parentSurface) { if (!s_waylandConnection.subCompositor) { return nullptr; } - auto s = s_waylandConnection.subCompositor->createSubSurface(surface, parentSurface, parent); + std::unique_ptr s(s_waylandConnection.subCompositor->createSubSurface(surface, parentSurface)); if (!s->isValid()) { - delete s; return nullptr; } return s;