summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ChangeLog5
-rw-r--r--src/nsfont.m7
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 <jan.h.d@swipnet.se>
+
+ * nsfont.m (ns_spec_to_descriptor): Retain and autorelease
+ fdesc (Bug#14375).
+
2013-05-12 Paul Eggert <eggert@cs.ucla.edu>
* 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];