From d705f5cd9d3bac765346af361038f2f9249183e7 Mon Sep 17 00:00:00 2001 From: Bjoern Erik Nilsen Date: Mon, 13 Jul 2009 10:48:43 +0200 Subject: Fix crash after "Remove QT_WA and non-Unicode code paths, dropping Win9x and NT support" tst_QGraphicsProxyWidget crashed because the QAlphaWidget tried to access a deleted widget. Before we had the if check, but that was removed with this commit: 55137901. Completely wrong, we must check the widget pointer before using it. Reviewed-by: jbache --- src/gui/widgets/qeffects.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/widgets/qeffects.cpp b/src/gui/widgets/qeffects.cpp index d6d0a16..f3b1b76 100644 --- a/src/gui/widgets/qeffects.cpp +++ b/src/gui/widgets/qeffects.cpp @@ -128,7 +128,8 @@ QAlphaWidget::~QAlphaWidget() { #if defined(Q_WS_WIN) && !defined(Q_WS_WINCE) // Restore user-defined opacity value - widget->setWindowOpacity(windowOpacity); + if (widget) + widget->setWindowOpacity(windowOpacity); #endif } -- cgit v0.12