From 1034e372f1b9ec972d9f0586321c8f299c3955f0 Mon Sep 17 00:00:00 2001 From: Prasanth Ullattil Date: Mon, 8 Jun 2009 13:31:40 +0200 Subject: Fix GDI object leak. In case the SetWindowRgn() fails, the region object has to be deleted. Task-number: 251293 Reviewed-by: Denis Dzyubenko --- src/gui/kernel/qwidget_win.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/kernel/qwidget_win.cpp b/src/gui/kernel/qwidget_win.cpp index 0f341fd..ea79329 100644 --- a/src/gui/kernel/qwidget_win.cpp +++ b/src/gui/kernel/qwidget_win.cpp @@ -1845,7 +1845,8 @@ void QWidgetPrivate::setMask_sys(const QRegion ®ion) OffsetRgn(wr, offset.x(), offset.y()); Q_ASSERT(q->testAttribute(Qt::WA_WState_Created)); - SetWindowRgn(data.winid, wr, true); + if (!SetWindowRgn(data.winid, wr, true)) + DeleteObject(wr); } void QWidgetPrivate::updateFrameStrut() -- cgit v0.12