summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2014-02-18 12:01:51 -0600
committerNorbert Thiebaud <nthiebaud@gmail.com>2014-02-18 12:06:23 -0600
commit7fd180c9d0014ac275422501e70e5122026eb364 (patch)
treec74e94e1bd86863012b942dd52ad7d3973f44798
parent263882acdcb7b54aacf834ae52de4ad56a1921bf (diff)
fix SIGBUS on mac due to Font Attribute not always available
Change-Id: I95c574e6386cacc473cad232100a224ff6a08dbb
-rw-r--r--vcl/quartz/ctfonts.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index e5c3f5931149..6008aef625f2 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -310,9 +310,12 @@ ImplDevFontAttributes DevFontFromCTFontDescriptor( CTFontDescriptorRef pFD, bool
CFStringRef pUILang = CFStringCreateWithCharacters( kCFAllocatorDefault, aUILang.getStr(), aUILang.getLength() );
CFStringRef pLang = NULL;
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 );
}
#else