From 4df92b8b5e7f44d7a5e2b91f23638c92512b41f9 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Thu, 24 Jun 2010 12:45:27 +0200 Subject: 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 --- src/gui/text/qfontdatabase_s60.cpp | 2 ++ 1 file changed, 2 insertions(+) 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(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 -- cgit v0.12