From abc0fc64b3d797af4d47cd2f7e3df68a3114c120 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 30 Sep 2019 13:21:47 +0200 Subject: QQuickWindow: Don't leak the animation controller There are ways to close the window without hitting the code paths in the render loops that delete the animation controller. Probably if no frame was ever rendered. Change-Id: If3e9d2051525c4ff50eda19084c967578fe4f4b0 Reviewed-by: Simon Hausmann --- src/quick/scenegraph/qsgthreadedrenderloop.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/quick/scenegraph/qsgthreadedrenderloop.cpp') diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp index 3689f6501f..86d9590863 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp +++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp @@ -564,7 +564,7 @@ void QSGRenderThread::invalidateGraphics(QQuickWindow *window, bool inDestructor QCoreApplication::processEvents(); QCoreApplication::sendPostedEvents(nullptr, QEvent::DeferredDelete); if (inDestructor) - delete dd->animationController; + dd->animationController.reset(); if (current && gl) gl->doneCurrent(); qCDebug(QSG_LOG_RENDERLOOP, QSG_RT_PAD, "- invalidating scene graph"); @@ -1302,7 +1302,8 @@ void QSGThreadedRenderLoop::handleExposure(QQuickWindow *window) } } - QQuickAnimatorController *controller = QQuickWindowPrivate::get(w->window)->animationController; + QQuickAnimatorController *controller + = QQuickWindowPrivate::get(w->window)->animationController.get(); if (controller->thread() != w->thread) controller->moveToThread(w->thread); -- cgit v1.2.3