From 79519407615442e29c045e5d7ac3fc044aff40fc Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Wed, 17 Aug 2022 11:28:07 +0200 Subject: [PATCH] Don't use release() on a unique_ptr if we don't intend to release ownership There is nothing indicating that `OffscreenQuickScene::rootItem()` releases ownership. Additionally, calling it multiple times currently means we get a nullptr the second time we call it which crashes the outputlocator effect. --- src/libkwineffects/kwinoffscreenquickview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libkwineffects/kwinoffscreenquickview.cpp b/src/libkwineffects/kwinoffscreenquickview.cpp index 49694d8840..e9f11b48d0 100644 --- a/src/libkwineffects/kwinoffscreenquickview.cpp +++ b/src/libkwineffects/kwinoffscreenquickview.cpp @@ -692,7 +692,7 @@ QQmlContext *OffscreenQuickScene::rootContext() const QQuickItem *OffscreenQuickScene::rootItem() const { - return d->quickItem.release(); + return d->quickItem.get(); } } // namespace KWin