aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorMike Achtelik <mike.achtelik@gmail.com>2021-01-20 16:14:46 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-01-26 16:37:01 +0000
commit1fc81ad78c66e76d6c96b43bd67cf969b91d67ca (patch)
tree8317df45945bdd60a177d5ac0622501c3fac0251 /src/quick
parentd338fbb1df8d306a6b74d425afe7f35be7262041 (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/quick')
-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 0270f41e55..2b39153723 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;
};