From 8fdeaad563abf86083da6e50e2619291b7d1e455 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Dj=C3=A4rv?= Date: Tue, 14 May 2013 11:34:16 +0200 Subject: [PATCH] * nsfont.m (ns_spec_to_descriptor): Retain and autorelease fdesc. Fixes: debbugs:14375 --- src/ChangeLog | 5 +++++ src/nsfont.m | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 836f6d4b7b8..db766c78e6c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2013-05-14 Jan Djärv + + * nsfont.m (ns_spec_to_descriptor): Retain and autorelease + fdesc (Bug#14375). + 2013-05-12 Paul Eggert * image.c (gif_load): Check that subimages fit (Bug#14345). diff --git a/src/nsfont.m b/src/nsfont.m index ebee363651f..9ab369d1fcd 100644 --- a/src/nsfont.m +++ b/src/nsfont.m @@ -151,10 +151,13 @@ ns_spec_to_descriptor (Lisp_Object font_spec) if ([tdict count] > 0) [fdAttrs setObject: tdict forKey: NSFontTraitsAttribute]; - fdesc = [NSFontDescriptor fontDescriptorWithFontAttributes: fdAttrs]; + fdesc = [[[NSFontDescriptor fontDescriptorWithFontAttributes: fdAttrs] + retain] autorelease]; + if (family != nil) { - fdesc = [fdesc fontDescriptorWithFamily: family]; + NSFontDescriptor *fdesc2 = [fdesc fontDescriptorWithFamily: family]; + fdesc = [[fdesc2 retain] autorelease]; } [fdAttrs release]; -- 2.39.2