From c46b330fa721e82849194472651430ce255d06e1 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Mon, 11 Oct 2021 15:37:33 +0200 Subject: Revert "Fix for possible crash in QSGDefaultLayer::grab" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1c5de027d0c31d1d6697bd0557128d92207763d8. The fix here is not correct. Calling a QSGRhiLayer function from the gui thread is very wrong and can cause a set of unexpected issues. The Address Sanitizer catches this by recognizing that the render thread is trying to do something with an object destroyed in the meantime on the main thread in the layer->setItem(null) call. The issue the original fix is trying to address needs to be addressed in some different form. Fixes: QTBUG-94975 Change-Id: I46f904026281201fc6d233ed7d3bdc7080934afe Reviewed-by: Christian Strømme (cherry picked from commit a5f0361622eb08eab6c3474d5fc249d1962e3d1e) Reviewed-by: Qt Cherry-pick Bot --- src/quick/items/qquickshadereffectsource.cpp | 8 -------- src/quick/items/qquickshadereffectsource_p.h | 1 - 2 files changed, 9 deletions(-) diff --git a/src/quick/items/qquickshadereffectsource.cpp b/src/quick/items/qquickshadereffectsource.cpp index 4f61d61309..b298ed74da 100644 --- a/src/quick/items/qquickshadereffectsource.cpp +++ b/src/quick/items/qquickshadereffectsource.cpp @@ -344,7 +344,6 @@ void QQuickShaderEffectSource::setSourceItem(QQuickItem *item) d->refFromEffectItem(m_hideSource); d->addItemChangeListener(this, QQuickItemPrivate::Geometry); connect(m_sourceItem, SIGNAL(destroyed(QObject*)), this, SLOT(sourceItemDestroyed(QObject*))); - connect(m_sourceItem, SIGNAL(parentChanged(QQuickItem*)), this, SLOT(sourceItemParentChanged(QQuickItem*))); } else { qWarning("ShaderEffectSource: sourceItem and ShaderEffectSource must both be children of the same window."); m_sourceItem = nullptr; @@ -364,13 +363,6 @@ void QQuickShaderEffectSource::sourceItemDestroyed(QObject *item) } -void QQuickShaderEffectSource::sourceItemParentChanged(QQuickItem *parent) -{ - if (!parent && m_texture) - m_texture->setItem(0); -} - - /*! \qmlproperty rect QtQuick::ShaderEffectSource::sourceRect diff --git a/src/quick/items/qquickshadereffectsource_p.h b/src/quick/items/qquickshadereffectsource_p.h index 921038e49a..fe419e5959 100644 --- a/src/quick/items/qquickshadereffectsource_p.h +++ b/src/quick/items/qquickshadereffectsource_p.h @@ -174,7 +174,6 @@ Q_SIGNALS: private Q_SLOTS: void sourceItemDestroyed(QObject *item); void invalidateSceneGraph(); - void sourceItemParentChanged(QQuickItem *parent); protected: void releaseResources() override; -- cgit v1.2.3