diff options
author | Mike Achtelik <mike.achtelik@gmail.com> | 2021-01-20 16:14:46 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-02-11 14:54:35 +0000 |
commit | be794a433489b2d580abbfb8f54cc2a26a5aa92b (patch) | |
tree | c77367b3e3bad02fba9318b7e905ecf49f89b0d2 /src | |
parent | 2426d3aec582e929cf1390368968427676f56160 (diff) |
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 <laszlo.agocs@qt.io>
(cherry picked from commit bac93541ba324e75c532c1987e861109e1c5b131)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/quick/items/qquickwindow.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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<QSGRenderLoop> m_renderLoop; int m_incubation_time; int m_timer; }; |