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>
This commit is contained in:
Jian Liang 2012-04-14 15:50:58 +08:00 committed by Qt by Nokia
parent ba1309e1f4
commit addffb71b4

View File

@ -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