Blame SOURCES/0011-Revert-Fix-for-possible-crash-in-QSGDefaultLayer-gra.patch

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