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/qquickopenglshadereffect.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/qquickopenglshadereffect.cpp')
-rw-r--r-- | src/quick/items/qquickopenglshadereffect.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/quick/items/qquickopenglshadereffect.cpp b/src/quick/items/qquickopenglshadereffect.cpp index 76cb3ace5c..3aa00340b2 100644 --- a/src/quick/items/qquickopenglshadereffect.cpp +++ b/src/quick/items/qquickopenglshadereffect.cpp @@ -221,7 +221,7 @@ QQuickOpenGLShaderEffectCommon::~QQuickOpenGLShaderEffectCommon() clearSignalMappers(shaderType); } -void QQuickOpenGLShaderEffectCommon::disconnectPropertySignals(QObject *obj, Key::ShaderType shaderType) +void QQuickOpenGLShaderEffectCommon::disconnectPropertySignals(QQuickItem *item, Key::ShaderType shaderType) { for (int i = 0; i < uniformData[shaderType].size(); ++i) { if (signalMappers[shaderType].at(i) == 0) @@ -229,11 +229,12 @@ void QQuickOpenGLShaderEffectCommon::disconnectPropertySignals(QObject *obj, Key const UniformData &d = uniformData[shaderType].at(i); auto mapper = signalMappers[shaderType].at(i); void *a = mapper; - QObjectPrivate::disconnect(obj, mapper->signalIndex(), &a); + QObjectPrivate::disconnect(item, mapper->signalIndex(), &a); if (d.specialType == UniformData::Sampler || d.specialType == UniformData::SamplerExternal) { QQuickItem *source = qobject_cast<QQuickItem *>(qvariant_cast<QObject *>(d.value)); if (source) { - QQuickItemPrivate::get(source)->derefWindow(); + if (item->window()) + QQuickItemPrivate::get(source)->derefWindow(); QObject::disconnect(source, SIGNAL(destroyed(QObject*)), host, SLOT(sourceDestroyed(QObject*))); } } |