aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Achtelik <mike.achtelik@gmail.com>2021-01-20 16:14:46 +0100
committerMike Achtelik <mike.achtelik@gmail.com>2021-01-26 16:23:58 +0100
commitbac93541ba324e75c532c1987e861109e1c5b131 (patch)
treed7bbcec929fd486174311b1ea82a401c2c9f09e2
parentc2d951d8b0cdd475ada0987016041bb5e946f9ac (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 Pick-to: 5.15 Pick-to: 6.0 Change-Id: I528e06ff22dfcad804593db6771d9163b21808f4 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r--src/quick/items/qquickwindow.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index ccacc5d5a6..5e4fa0c43f 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -171,7 +171,7 @@ protected:
public slots:
void incubate() {
- if (incubatingObjectCount()) {
+ if (m_renderLoop && incubatingObjectCount()) {
if (m_renderLoop->interleaveIncubation()) {
incubateFor(m_incubation_time);
} else {
@@ -187,12 +187,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;
};