Mac OS X: Fix possible crash when using some TrueType fonts.

This is just a workaround. We simply avoid removing the custom font
(intentionally leak it, a small price to pay) because otherwise it will
invalidate Qt's font cache, which in turns trigger the crash at
CoreText's CTFontCopyGraphicsFont.

http://code.google.com/p/phantomjs/issues/detail?id=690
1.9
Ariya Hidayat 2012-12-29 01:11:54 -08:00
parent 2a2b6e455c
commit d0fe6864a9
1 changed files with 4 additions and 0 deletions

View File

@ -32,7 +32,11 @@ namespace WebCore {
FontCustomPlatformData::~FontCustomPlatformData()
{
#if !defined(Q_OS_MAC)
// On Mac OS X, do not remove the font because it may crash.
// For details, see issue 690 (http://code.google.com/p/phantomjs/issues/detail?id=690).
QFontDatabase::removeApplicationFont(m_handle);
#endif
}
FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontOrientation, TextOrientation, FontWidthVariant, FontRenderingMode)