summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJian Liang <jianliang79@gmail.com>2012-04-14 15:50:58 +0800
committerQt by Nokia <qt-info@nokia.com>2012-04-17 16:28:46 +0200
commitaddffb71b45b5123ee449f0cfa4891dcab044a9f (patch)
tree9e4a568081461062509bb286056825df3e98b67b
parentba1309e1f40e64420c45880d568260a259dad47b (diff)
Fix memory leak of QFontEngineData
Move QFont::cleanup(); and cleanupThreadData(); to the end of destructor of QGuiApplicationPrivate class. This is because they will trigger the QFontCache::~QFontCache() function being called and at that time the platform_theme object still hold some fonts object, This will cause the QFontEngineData object hold by those fonts can never been deleted. Change-Id: I4d3f21c5e2683706f68395ba3ad24203081e1d1d Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
-rw-r--r--src/gui/kernel/qguiapplication.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp
index f7675f5267..e1ab64bc33 100644
--- a/src/gui/kernel/qguiapplication.cpp
+++ b/src/gui/kernel/qguiapplication.cpp
@@ -875,16 +875,12 @@ QGuiApplicationPrivate::~QGuiApplicationPrivate()
clearFontUnlocked();
- QFont::cleanup();
-
#ifndef QT_NO_CURSOR
QCursorData::cleanup();
#endif
layout_direction = Qt::LeftToRight;
- cleanupThreadData();
-
delete styleHints;
delete inputMethod;
@@ -896,6 +892,10 @@ QGuiApplicationPrivate::~QGuiApplicationPrivate()
delete platform_integration;
platform_integration = 0;
delete m_gammaTables.load();
+
+ QFont::cleanup();
+
+ cleanupThreadData();
}
#if 0