diff options
author | Prasanth Ullattil <prasanth.ullattil@nokia.com> | 2009-06-08 11:31:40 (GMT) |
---|---|---|
committer | Prasanth Ullattil <prasanth.ullattil@nokia.com> | 2009-06-08 11:40:41 (GMT) |
commit | 1034e372f1b9ec972d9f0586321c8f299c3955f0 (patch) | |
tree | 855474120c5de8631748890285081824f195c747 | |
parent | 2dbd8c48c11deb7732920d88f8b6c20bf162bd6b (diff) | |
download | Qt-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
-rw-r--r-- | src/gui/kernel/qwidget_win.cpp | 3 |
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 ®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() |