diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-05-27 16:32:00 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-05-28 11:07:11 +0000 |
commit | 5af16fb4dfa39ead82240f5ffbc004634f3c288f (patch) | |
tree | 107059658e51419a4fbb3fd97c9067b9f9402e53 /src/quick/items/qquickshadereffect.cpp | |
parent | f330b6a667babea9491872b1dcd68816a6c095ba (diff) |
Fix mistakes in 9b36512b9453f429644b0c388d381f7a2fc0f825
Undo change to signature of textureProviderDestroyed, and
reinstate test for disconnected item having a window, and
instead ensure we are destroyed earlier while the item is
still valid.
Fixes: QTBUG-76055
Change-Id: I0c6c13cd44d3364984e0245b3b048f4aa183b43a
Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
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 |