Details
Description
We have found that running a Qt application using QtWebkit on symbian crashes on exit with a FBSClient panic.
The root cause of this panic seems to be CFonts that still have references in the S60 font database implementation. In webkit there are lots of statics which do not get deleted until the process dies (or not deleted at all), this causes font handles to be leaked and panics when the Symbian Eikon environment is destroyed.
There is a workaround to forcefully flush all font data in the following function:
void QFontCache::cleanup()
{
QFontCache::instance()->clear(); // Call clear here will deref all left over handles
QThreadStorage<QFontCache *> *cache = 0;
QT_TRY
QT_CATCH (const std::bad_alloc &)
{ // no cache - just ignore } if (cache && cache->hasLocalData())
cache->setLocalData(0);
}
Adding "QFontCache::instance()->clear();" flushes the font database and releases all handles so that it passes the environment shutdown tests.
I will try to provide more information on where the font data is leaked in webkit, but it seems to be necessary to flush the DB as we cannot clear static datas.