diff options
author | Sami Merila <sami.merila@nokia.com> | 2010-09-03 12:11:13 (GMT) |
---|---|---|
committer | Sami Merila <sami.merila@nokia.com> | 2010-09-03 12:11:13 (GMT) |
commit | 8d42b6ac40ee57857b8b57934c9c6bbe05809720 (patch) | |
tree | 2894c19a16b6797bcd61ff3b4e1517c41cb8c4e8 /src | |
parent | 9c726c2f2791f82de52f54ffc1f580630d10c61d (diff) | |
download | Qt-8d42b6ac40ee57857b8b57934c9c6bbe05809720.zip Qt-8d42b6ac40ee57857b8b57934c9c6bbe05809720.tar.gz Qt-8d42b6ac40ee57857b8b57934c9c6bbe05809720.tar.bz2 |
Plug memory leak from QS60Style
Currently style leaks an animation object (QS60StyleAnimation) when
style is destroyed. To avoid this, animation object array is
deleted in the style's destructor.
Task-number: QTBUG-13145
Reviewed-by: mread
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/styles/qs60style.cpp | 3 | ||||
-rw-r--r-- | src/gui/styles/qs60style_p.h | 1 | ||||
-rw-r--r-- | src/gui/styles/qs60style_s60.cpp | 6 |
3 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 0ba1bc6..36210b8 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -154,6 +154,9 @@ QS60StylePrivate::~QS60StylePrivate() { clearCaches(); //deletes also background image deleteThemePalette(); +#ifdef Q_WS_S60 + removeAnimations(); +#endif } void QS60StylePrivate::drawSkinElement(SkinElements element, QPainter *painter, diff --git a/src/gui/styles/qs60style_p.h b/src/gui/styles/qs60style_p.h index 836969a..51ced96 100644 --- a/src/gui/styles/qs60style_p.h +++ b/src/gui/styles/qs60style_p.h @@ -571,6 +571,7 @@ public: void startAnimation(QS60StyleEnums::SkinParts animation); void stopAnimation(QS60StyleEnums::SkinParts animation); static QS60StyleAnimation* animationDefinition(QS60StyleEnums::SkinParts part); + static void removeAnimations(); #endif diff --git a/src/gui/styles/qs60style_s60.cpp b/src/gui/styles/qs60style_s60.cpp index f44b85e..5dda42e 100644 --- a/src/gui/styles/qs60style_s60.cpp +++ b/src/gui/styles/qs60style_s60.cpp @@ -1152,6 +1152,12 @@ QS60StylePrivate::QS60StylePrivate() setActiveLayout(); } +void QS60StylePrivate::removeAnimations() +{ + //currently only one animation in the list. + m_animations()->removeFirst(); +} + QColor QS60StylePrivate::s60Color(QS60StyleEnums::ColorLists list, int index, const QStyleOption *option) { |