From b2b9fdfda0f7838059d7e826d81740977ef35a6e Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Mon, 15 Sep 2014 16:23:02 +0200 Subject: QSizeGrip: use a QPointer to the tracked TLW And not a normal pointer. The problem is that in certain scenarios, if the TLW containing a QSizeGrip changes and the old TLW gets immediately destroyed, then the mechanism which updates the tracked TLW is run too late, and ends up accessing a dangling pointer. Therefore, we need to protect that pointer via a smart pointer. Task-number: QTBUG-22867 Change-Id: Icfb051132bacde604f660ac7a98bc0a9d1022c68 Reviewed-by: Marc Mutz --- src/widgets/widgets/qsizegrip.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/widgets/widgets/qsizegrip.cpp b/src/widgets/widgets/qsizegrip.cpp index e46de3958f..5994071bfc 100644 --- a/src/widgets/widgets/qsizegrip.cpp +++ b/src/widgets/widgets/qsizegrip.cpp @@ -83,7 +83,7 @@ public: int dyMax; Qt::Corner m_corner; bool gotMousePress; - QWidget *tlw; + QPointer tlw; #ifdef Q_WS_MAC void updateMacSizer(bool hide) const; #endif -- cgit v1.2.3