aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickitem.cpp
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2021-03-31 16:00:38 +0200
committerFabian Kosmale <fabian.kosmale@qt.io>2021-03-31 22:49:46 +0200
commitf8fc2d11a9cb2c55f4efc4a089663967ff78cc0b (patch)
tree095f010e7997f5855e00564396997622300a8de3 /src/quick/items/qquickitem.cpp
parent080ce397dc907e66c117b7fe84f4d2e1004773d0 (diff)
QQuickItem: Do not dereference nullptr
During engine shut-down, the delivery agent might already have been deleted, but we still get a call to setEffectiveVisibleRecur. Thus we need to check that the agent is non-null. Pick-to: 6.1 Change-Id: Ie2d5923d686789c0758913799ff0702a85a55402 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/quick/items/qquickitem.cpp')
-rw-r--r--src/quick/items/qquickitem.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index 739624445b..3a56929b95 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -6179,7 +6179,8 @@ bool QQuickItemPrivate::setEffectiveVisibleRecur(bool newEffectiveVisible)
if (parentItem)
QQuickItemPrivate::get(parentItem)->dirty(ChildrenStackingChanged);
if (window)
- deliveryAgentPrivate()->removeGrabber(q, true, true, true);
+ if (auto agent = deliveryAgentPrivate(); agent)
+ agent->removeGrabber(q, true, true, true);
bool childVisibilityChanged = false;
for (int ii = 0; ii < childItems.count(); ++ii)