aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-09-30 13:21:47 +0200
committerUlf Hermann <ulf.hermann@qt.io>2019-10-02 11:20:05 +0200
commitabc0fc64b3d797af4d47cd2f7e3df68a3114c120 (patch)
treecfc11f3a5c8ee5acf03ea3ca8264388435d04782 /src/plugins
parent50e76d84bf6935e5d517c64c46b32c50d1e14ba9 (diff)
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 <simon.hausmann@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp2
-rw-r--r--src/plugins/scenegraph/d3d12/qsgd3d12threadedrenderloop.cpp4
-rw-r--r--src/plugins/scenegraph/openvg/qsgopenvgrenderloop.cpp2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp b/src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp
index 0d501f48c0..4a6894e69e 100644
--- a/src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp
+++ b/src/plugins/scenegraph/d3d12/qsgd3d12renderloop.cpp
@@ -148,7 +148,7 @@ void QSGD3D12RenderLoop::windowDestroyed(QQuickWindow *window)
delete rc;
delete engine;
- delete wd->animationController;
+ wd->animationController.reset();
}
void QSGD3D12RenderLoop::exposeWindow(QQuickWindow *window)
diff --git a/src/plugins/scenegraph/d3d12/qsgd3d12threadedrenderloop.cpp b/src/plugins/scenegraph/d3d12/qsgd3d12threadedrenderloop.cpp
index f505df1e5a..4302a9119b 100644
--- a/src/plugins/scenegraph/d3d12/qsgd3d12threadedrenderloop.cpp
+++ b/src/plugins/scenegraph/d3d12/qsgd3d12threadedrenderloop.cpp
@@ -373,7 +373,7 @@ bool QSGD3D12RenderThread::event(QEvent *e)
QCoreApplication::processEvents();
QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete);
if (wme->destroying)
- delete wd->animationController;
+ wd->animationController.reset();
}
if (wme->destroying)
active = false;
@@ -1006,7 +1006,7 @@ void QSGD3D12ThreadedRenderLoop::handleExposure(QQuickWindow *window)
if (Q_UNLIKELY(debug_loop()))
qDebug("starting render thread");
// Push a few things to the render thread.
- QQuickAnimatorController *controller = QQuickWindowPrivate::get(w->window)->animationController;
+ QQuickAnimatorController *controller = QQuickWindowPrivate::get(w->window)->animationController.data();
if (controller->thread() != w->thread)
controller->moveToThread(w->thread);
if (w->thread->thread() == QThread::currentThread()) {
diff --git a/src/plugins/scenegraph/openvg/qsgopenvgrenderloop.cpp b/src/plugins/scenegraph/openvg/qsgopenvgrenderloop.cpp
index 94f7f76036..69b10fcdee 100644
--- a/src/plugins/scenegraph/openvg/qsgopenvgrenderloop.cpp
+++ b/src/plugins/scenegraph/openvg/qsgopenvgrenderloop.cpp
@@ -96,7 +96,7 @@ void QSGOpenVGRenderLoop::windowDestroyed(QQuickWindow *window)
vg->doneCurrent();
}
- delete d->animationController;
+ d->animationController.reset();
}
void QSGOpenVGRenderLoop::exposureChanged(QQuickWindow *window)