From fd469b45100074e44e8bfb57e732b25a29dc2acd Mon Sep 17 00:00:00 2001 From: Romain Pokrzywka Date: Wed, 25 Mar 2020 00:46:15 -0500 Subject: Avoid stale QSGTexture pointer accesses On rare occasions, it seems to be possible for the texture to be used after deletion, which results in crashes in pixmap() after casting. Rather than storing a raw pointer, wrap the texture in QPointer to avoid the stale pointer accesses. Task-number: QTBUG-80415 Change-Id: Ia0ee556f4a3a4eee777ca14065635f4bc5f90da2 Reviewed-by: Andy Nichols (cherry picked from commit 1c010b202506bb7eb0f0e24ab37ad50e319abada) Reviewed-by: Qt Cherry-pick Bot --- .../scenegraph/adaptations/software/qsgsoftwareinternalimagenode_p.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/quick/scenegraph/adaptations/software/qsgsoftwareinternalimagenode_p.h b/src/quick/scenegraph/adaptations/software/qsgsoftwareinternalimagenode_p.h index b80bacbaa0..af912e1a3f 100644 --- a/src/quick/scenegraph/adaptations/software/qsgsoftwareinternalimagenode_p.h +++ b/src/quick/scenegraph/adaptations/software/qsgsoftwareinternalimagenode_p.h @@ -54,6 +54,8 @@ #include #include +#include + QT_BEGIN_NAMESPACE namespace QSGSoftwareHelpers { @@ -132,7 +134,7 @@ private: QRectF m_innerSourceRect; QRectF m_subSourceRect; - QSGTexture *m_texture; + QPointer m_texture; QPixmap m_cachedMirroredPixmap; bool m_mirror; -- cgit v1.2.3