diff options
Diffstat (limited to 'src/quick/items/qquickshadereffect.cpp')
-rw-r--r-- | src/quick/items/qquickshadereffect.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/quick/items/qquickshadereffect.cpp b/src/quick/items/qquickshadereffect.cpp index 05d9e5e36d..3721731f68 100644 --- a/src/quick/items/qquickshadereffect.cpp +++ b/src/quick/items/qquickshadereffect.cpp @@ -515,6 +515,20 @@ QQuickShaderEffect::QQuickShaderEffect(QQuickItem *parent) m_impl = new QQuickGenericShaderEffect(this, this); } +QQuickShaderEffect::~QQuickShaderEffect() +{ + // Delete the implementations now, while they still have have + // valid references back to us. +#if QT_CONFIG(opengl) + auto *glImpl = m_glImpl; + m_glImpl = nullptr; + delete glImpl; +#endif + auto *impl = m_impl; + m_impl = nullptr; + delete impl; +} + /*! \qmlproperty string QtQuick::ShaderEffect::fragmentShader |