aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/quick/items/qquickshadereffect.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/quick/items/qquickshadereffect.cpp b/src/quick/items/qquickshadereffect.cpp
index 78458ce6b0..1d931a656f 100644
--- a/src/quick/items/qquickshadereffect.cpp
+++ b/src/quick/items/qquickshadereffect.cpp
@@ -843,7 +843,11 @@ void QQuickShaderEffect::itemChange(ItemChange change, const ItemChangeData &val
return;
}
#endif
- m_impl->handleItemChange(change, value);
+ // It's possible for itemChange to be called during destruction when deleting
+ // the QQuickShaderEffectImpl. We nullify m_impl before deleting it via another pointer
+ // to it, so we must check that it's not null before trying to use it here.
+ if (m_impl)
+ m_impl->handleItemChange(change, value);
QQuickItem::itemChange(change, value);
}