From be794a433489b2d580abbfb8f54cc2a26a5aa92b Mon Sep 17 00:00:00 2001 From: Mike Achtelik Date: Wed, 20 Jan 2021 16:14:46 +0100 Subject: QQuickWindowIncubationController: Use QPointer to guard QSGRenderLoop reference In some cases, when the QGuiApplication is shutting down while there is an active QAnimationDriver and an incubating object, the QQuickWindowIncubationController will try to access an already destroyed QSGRenderLoop. So use a QPointer to guard the QSGRenderLoop access. Fixes: QTBUG-90489 Change-Id: I528e06ff22dfcad804593db6771d9163b21808f4 Reviewed-by: Laszlo Agocs (cherry picked from commit bac93541ba324e75c532c1987e861109e1c5b131) Reviewed-by: Qt Cherry-pick Bot --- src/quick/items/qquickwindow.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 19a5cb3796..bc9179c6c8 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -164,7 +164,7 @@ protected: public slots: void incubate() { - if (incubatingObjectCount()) { + if (m_renderLoop && incubatingObjectCount()) { if (m_renderLoop->interleaveIncubation()) { incubateFor(m_incubation_time); } else { @@ -180,12 +180,12 @@ public slots: protected: void incubatingObjectCountChanged(int count) override { - if (count && !m_renderLoop->interleaveIncubation()) + if (count && m_renderLoop && !m_renderLoop->interleaveIncubation()) incubateAgain(); } private: - QSGRenderLoop *m_renderLoop; + QPointer m_renderLoop; int m_incubation_time; int m_timer; }; -- cgit v1.2.3