Kaydet (Commit) 7fd180c9 authored tarafından Norbert Thiebaud's avatar Norbert Thiebaud

fix SIGBUS on mac due to Font Attribute not always available

Change-Id: I95c574e6386cacc473cad232100a224ff6a08dbb
üst 263882ac
...@@ -310,9 +310,12 @@ ImplDevFontAttributes DevFontFromCTFontDescriptor( CTFontDescriptorRef pFD, bool ...@@ -310,9 +310,12 @@ ImplDevFontAttributes DevFontFromCTFontDescriptor( CTFontDescriptorRef pFD, bool
CFStringRef pUILang = CFStringCreateWithCharacters( kCFAllocatorDefault, aUILang.getStr(), aUILang.getLength() ); CFStringRef pUILang = CFStringCreateWithCharacters( kCFAllocatorDefault, aUILang.getStr(), aUILang.getLength() );
CFStringRef pLang = NULL; CFStringRef pLang = NULL;
CFStringRef pFamilyName = (CFStringRef)CTFontDescriptorCopyLocalizedAttribute( pFD, kCTFontFamilyNameAttribute, &pLang ); CFStringRef pFamilyName = (CFStringRef)CTFontDescriptorCopyLocalizedAttribute( pFD, kCTFontFamilyNameAttribute, &pLang );
if ( CFStringCompare( pUILang, pLang, 0 ) != kCFCompareEqualTo ) if ( !pLang || ( CFStringCompare( pUILang, pLang, 0 ) != kCFCompareEqualTo ))
{ {
CFRelease( pFamilyName ); if(pFamilyName)
{
CFRelease( pFamilyName );
}
pFamilyName = (CFStringRef)CTFontDescriptorCopyAttribute( pFD, kCTFontFamilyNameAttribute ); pFamilyName = (CFStringRef)CTFontDescriptorCopyAttribute( pFD, kCTFontFamilyNameAttribute );
} }
#else #else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment