diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2014-02-18 12:01:51 -0600 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2014-02-18 12:06:23 -0600 |
commit | 7fd180c9d0014ac275422501e70e5122026eb364 (patch) | |
tree | c74e94e1bd86863012b942dd52ad7d3973f44798 /vcl/quartz/ctfonts.cxx | |
parent | 263882acdcb7b54aacf834ae52de4ad56a1921bf (diff) |
fix SIGBUS on mac due to Font Attribute not always available
Change-Id: I95c574e6386cacc473cad232100a224ff6a08dbb
Diffstat (limited to 'vcl/quartz/ctfonts.cxx')
-rw-r--r-- | vcl/quartz/ctfonts.cxx | 7 |
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 |