Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Commit

Permalink
Mac OS X: Fix possible crash when using some TrueType fonts.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ariya committed Dec 31, 2012
1 parent 2a2b6e4 commit d0fe686
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d0fe686

Please sign in to comment.