diff options
author | jian liang <jianliang79@gmail.com> | 2012-02-04 19:53:54 +0800 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-10 00:27:44 +0100 |
commit | c6a1cb701ce1a973d9c950161d72db0e7f9a6b7c (patch) | |
tree | 6a23e945277f71fb586e6de95b3fa526201de788 /src/gui/kernel/qguiapplication.cpp | |
parent | cd2a2251d1a739b5d84f2543c280cf399eba47d0 (diff) |
Improvement to font database cleanup
This patch do the following things:
1) Call QFontDatabasePrivate::free() to clean up font database before
destroying the platform integration object. This is to prevent object leak
which is allocated by platform plugin.
2) Allocate FontFile structure for each font registered in windows
platform to prevent double free of FontFile structure.
3) qt_registerFont() will release the old handle of the registered font
and replace it with the new handle. This is to prevent FontFont structure
leak.
Change-Id: Ib5ca20c695e1e365689fd8554f7caff6ee77a0b1
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
Diffstat (limited to 'src/gui/kernel/qguiapplication.cpp')
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index b1cbb5fcae..d41c90636b 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -502,6 +502,8 @@ void QGuiApplicationPrivate::init() QWindowSystemInterface::sendWindowSystemEvents(QCoreApplicationPrivate::eventDispatcher, QEventLoop::AllEvents); } +extern void qt_cleanupFontDatabase(); + QGuiApplicationPrivate::~QGuiApplicationPrivate() { is_app_closing = true; @@ -526,6 +528,8 @@ QGuiApplicationPrivate::~QGuiApplicationPrivate() delete styleHints; delete inputMethod; + qt_cleanupFontDatabase(); + delete platform_integration; platform_integration = 0; } |