]> git.eshelyaron.com Git - emacs.git/commitdiff
* nsfont.m (ns_spec_to_descriptor): Retain and autorelease fdesc.
authorJan Djärv <jan.h.d@swipnet.se>
Tue, 14 May 2013 09:34:16 +0000 (11:34 +0200)
committerJan Djärv <jan.h.d@swipnet.se>
Tue, 14 May 2013 09:34:16 +0000 (11:34 +0200)
Fixes: debbugs:14375
src/ChangeLog
src/nsfont.m

index 836f6d4b7b808ae03c6311d895931151688fa116..db766c78e6ce1c771cc7f6a6d9b07cf7668dd69a 100644 (file)
@@ -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).
index ebee363651f16d751d18c36c96e4fc447ec9d248..9ab369d1fcd905a2a3f4fe2c24c26d665fe0b239 100644 (file)
@@ -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];