diff options
author | Alessandro Portale <alessandro.portale@nokia.com> | 2010-06-24 10:45:27 (GMT) |
---|---|---|
committer | Alessandro Portale <alessandro.portale@nokia.com> | 2010-06-24 10:45:27 (GMT) |
commit | 4df92b8b5e7f44d7a5e2b91f23638c92512b41f9 (patch) | |
tree | 837075f6d5b97f1ca3ec6280a03e35465af0f64c | |
parent | d8ffdacc0aa0b22a02b8ac3bae03570049b65d5d (diff) | |
download | Qt-4df92b8b5e7f44d7a5e2b91f23638c92512b41f9.zip Qt-4df92b8b5e7f44d7a5e2b91f23638c92512b41f9.tar.gz Qt-4df92b8b5e7f44d7a5e2b91f23638c92512b41f9.tar.bz2 |
Don't crash when cleaning the uninitialized fontdatabase (Symbian)
Applications that do not render fonts will not cause a call to
initializeDb(). In that case, there will be no creation of
QSymbianFontDatabaseExtras.
This fix adds a NULL-pointer check before cleaning the
QSymbianFontDatabaseExtras instance.
Task-number: QTBUG-11683
Reviewed-by: Miikka Heikkinen
-rw-r--r-- | src/gui/text/qfontdatabase_s60.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/text/qfontdatabase_s60.cpp b/src/gui/text/qfontdatabase_s60.cpp index 5148568..0b38aab 100644 --- a/src/gui/text/qfontdatabase_s60.cpp +++ b/src/gui/text/qfontdatabase_s60.cpp @@ -162,6 +162,8 @@ void qt_cleanup_symbianFontDatabaseExtras() { const QSymbianFontDatabaseExtrasImplementation *dbExtras = static_cast<const QSymbianFontDatabaseExtrasImplementation*>(privateDb()->symbianExtras); + if (!dbExtras) + return; // initializeDb() has never been called #ifdef Q_SYMBIAN_HAS_FONTTABLE_API qDeleteAll(dbExtras->m_extrasHash); #else // Q_SYMBIAN_HAS_FONTTABLE_API |