summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-04-07 07:37:31 (GMT)
committerLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-04-07 09:38:54 (GMT)
commita12d41076919a133e63de63dff5c1a131a0564e4 (patch)
tree9549ad67b3485430e29ab7032761297b229cda92 /src
parentf870613ee5632c1af87a71948dc302015d1a1d75 (diff)
downloadQt-a12d41076919a133e63de63dff5c1a131a0564e4.zip
Qt-a12d41076919a133e63de63dff5c1a131a0564e4.tar.gz
Qt-a12d41076919a133e63de63dff5c1a131a0564e4.tar.bz2
Have the backing store destroyed also in special Symbian scenarios.
The backing store tracker's registerWidget and unregisterWidget functions are called when EPartiallyVisible and ENotVisible events come from WSERV. However if an application sends its window group to background right after caling show() and before entering the event loop, there is a chance that all the application will receive is an ENotVisible event, leading to calling unregisterWidget() without a previous registerWidget(). In this case the backing store was not destroyed and the application was consuming GPU memory even while it was staying in background. This patch makes unregisterWidget() not to check the widget's presence in the m_widgets set, instead the condition for deleting the backing store is solely an empty set. Task-number: QTBUG-18493 Reviewed-by: Gareth Stockwell
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qwidget.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 0a73481..be615a4 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -234,7 +234,8 @@ void QWidgetBackingStoreTracker::registerWidget(QWidget *w)
*/
void QWidgetBackingStoreTracker::unregisterWidget(QWidget *w)
{
- if (m_widgets.remove(w) && m_widgets.isEmpty()) {
+ m_widgets.remove(w);
+ if (m_widgets.isEmpty()) {
delete m_ptr;
m_ptr = 0;
}