summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfont.cpp
diff options
context:
space:
mode:
authorTrond Kjernåsen <trond.kjernasen@nokia.com>2010-04-27 11:46:57 (GMT)
committerTrond Kjernåsen <trond.kjernasen@nokia.com>2010-04-27 11:54:13 (GMT)
commitcc1d15dc46ecdc661e9eb96e0a6c2bd3832d5c83 (patch)
tree780a147ef749a1b781d6389ccc707db388838589 /src/gui/text/qfont.cpp
parent1f640fa57d6136f25b34d3ccf7994af62177da4c (diff)
downloadQt-cc1d15dc46ecdc661e9eb96e0a6c2bd3832d5c83.zip
Qt-cc1d15dc46ecdc661e9eb96e0a6c2bd3832d5c83.tar.gz
Qt-cc1d15dc46ecdc661e9eb96e0a6c2bd3832d5c83.tar.bz2
Fixed a QFontEngine leak for QFont objects used in threads.
Only the QFontCache object for the main thread was cleared when the the application exited, or a thread was destroyed. This caused font engine references to hang around and never get deleted. Task-number: QTBUG-3976 Reviewed-by: Brad
Diffstat (limited to 'src/gui/text/qfont.cpp')
-rw-r--r--src/gui/text/qfont.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index a41b000..b349bcf 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -2612,10 +2612,8 @@ void QFontCache::cleanup()
} QT_CATCH (const std::bad_alloc &) {
// no cache - just ignore
}
- if (cache && cache->hasLocalData()) {
- cache->localData()->clear();
+ if (cache && cache->hasLocalData())
cache->setLocalData(0);
- }
}
#endif // QT_NO_THREAD
@@ -2627,6 +2625,7 @@ QFontCache::QFontCache()
QFontCache::~QFontCache()
{
+ clear();
{
EngineDataCache::ConstIterator it = engineDataCache.constBegin(),
end = engineDataCache.constEnd();