summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
authorPrasanth Ullattil <prasanth.ullattil@nokia.com>2009-06-08 11:31:40 (GMT)
committerPrasanth Ullattil <prasanth.ullattil@nokia.com>2009-06-08 11:40:41 (GMT)
commit1034e372f1b9ec972d9f0586321c8f299c3955f0 (patch)
tree855474120c5de8631748890285081824f195c747 /src/gui/kernel
parent2dbd8c48c11deb7732920d88f8b6c20bf162bd6b (diff)
downloadQt-1034e372f1b9ec972d9f0586321c8f299c3955f0.zip
Qt-1034e372f1b9ec972d9f0586321c8f299c3955f0.tar.gz
Qt-1034e372f1b9ec972d9f0586321c8f299c3955f0.tar.bz2
Fix GDI object leak.
In case the SetWindowRgn() fails, the region object has to be deleted. Task-number: 251293 Reviewed-by: Denis Dzyubenko
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qwidget_win.cpp3
1 files changed, 2 insertions, 1 deletions
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 &region)
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()