summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontdatabase_s60.cpp
diff options
context:
space:
mode:
authormread <qt-info@nokia.com>2009-08-26 14:28:06 (GMT)
committermread <qt-info@nokia.com>2009-08-28 08:57:38 (GMT)
commit719d5ac4220744d17344ff07ffaa9e86c01ac412 (patch)
tree30dc926cf6b2df8a09ca8ab4e8c4f1aa36b4a34a /src/gui/text/qfontdatabase_s60.cpp
parent625dbf4edd3a1057e525c68c319e4525741ceaaa (diff)
downloadQt-719d5ac4220744d17344ff07ffaa9e86c01ac412.zip
Qt-719d5ac4220744d17344ff07ffaa9e86c01ac412.tar.gz
Qt-719d5ac4220744d17344ff07ffaa9e86c01ac412.tar.bz2
Deleting the CFontStore without a crash
CFontStore deletion crashes if there are any open fonts in it. These are now all deleted before the store is deleted. Reviewed-by: aportale
Diffstat (limited to 'src/gui/text/qfontdatabase_s60.cpp')
-rw-r--r--src/gui/text/qfontdatabase_s60.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gui/text/qfontdatabase_s60.cpp b/src/gui/text/qfontdatabase_s60.cpp
index 058041b..fe90010 100644
--- a/src/gui/text/qfontdatabase_s60.cpp
+++ b/src/gui/text/qfontdatabase_s60.cpp
@@ -126,8 +126,13 @@ QFontDatabaseS60StoreImplementation::QFontDatabaseS60StoreImplementation()
}
QFontDatabaseS60StoreImplementation::~QFontDatabaseS60StoreImplementation()
{
- qDeleteAll(m_extensions);
- // TODO m_store cleanup removed because it was crashing
+ typedef QHash<QString, const QFontEngineS60Extensions *>::iterator iterator;
+ for (iterator p = m_extensions.begin(); p != m_extensions.end(); ++p) {
+ m_store->ReleaseFont((*p)->fontOwner());
+ delete *p;
+ }
+
+ delete m_store;
m_heap->Close();
}
@@ -140,7 +145,7 @@ const QFontEngineS60Extensions *QFontDatabaseS60StoreImplementation::extension(c
const TInt err = m_store->GetNearestFontToDesignHeightInPixels(font, spec);
Q_ASSERT(err == KErrNone && font);
CBitmapFont *bitmapFont = static_cast<CBitmapFont*>(font);
- m_extensions.insert(typeface, new QFontEngineS60Extensions(bitmapFont->OpenFont()));
+ m_extensions.insert(typeface, new QFontEngineS60Extensions(font, bitmapFont->OpenFont()));
}
return m_extensions.value(typeface);
}