summaryrefslogtreecommitdiffstats
path: root/src/gui/styles
diff options
context:
space:
mode:
authorJens Bache-Wiig <jbache@trolltech.com>2009-07-13 15:53:34 (GMT)
committerJens Bache-Wiig <jbache@trolltech.com>2009-07-13 15:57:57 (GMT)
commit46df9f83cb64541f7d9ecd34645ef1558ce1c0c6 (patch)
tree905e41912c47f23fac3e39b49a29aae1ba8ca941 /src/gui/styles
parent3e5d7444b883778663d1e31e54afffae65921da3 (diff)
downloadQt-46df9f83cb64541f7d9ecd34645ef1558ce1c0c6.zip
Qt-46df9f83cb64541f7d9ecd34645ef1558ce1c0c6.tar.gz
Qt-46df9f83cb64541f7d9ecd34645ef1558ce1c0c6.tar.bz2
Fixed a potential memory leak on XP
Calling OpenThemeData directly causes a leak when changing the style as we do not call the corresponding CloseThemeData. Task-number:257916 Reviewed-by:prasanth
Diffstat (limited to 'src/gui/styles')
-rw-r--r--src/gui/styles/qwindowsxpstyle.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/styles/qwindowsxpstyle.cpp b/src/gui/styles/qwindowsxpstyle.cpp
index 2abf3bc..1b8ceae 100644
--- a/src/gui/styles/qwindowsxpstyle.cpp
+++ b/src/gui/styles/qwindowsxpstyle.cpp
@@ -1202,7 +1202,8 @@ QRect QWindowsXPStyle::subElementRect(SubElement sr, const QStyleOption *option,
if (const QStyleOptionButton *btn = qstyleoption_cast<const QStyleOptionButton *>(option)) {
MARGINS borderSize;
if (widget) {
- HTHEME theme = pOpenThemeData(QWindowsXPStylePrivate::winId(widget), L"Button");
+ XPThemeData buttontheme(widget, 0, QLatin1String("Button"));
+ HTHEME theme = buttontheme.handle();
if (theme) {
int stateId;
if (!(option->state & State_Enabled))
@@ -3611,7 +3612,8 @@ QSize QWindowsXPStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt
case CT_LineEdit:
case CT_ComboBox:
{
- HTHEME theme = pOpenThemeData(QWindowsXPStylePrivate::winId(widget), L"Button");
+ XPThemeData buttontheme(widget, 0, QLatin1String("Button"));
+ HTHEME theme = buttontheme.handle();
MARGINS borderSize;
if (theme) {
int result = pGetThemeMargins(theme,