emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 45372fb1f4: * src/nsfns.m (Fns_list_colors): Fix autoreleasing.


From: Po Lu
Subject: master 45372fb1f4: * src/nsfns.m (Fns_list_colors): Fix autoreleasing.
Date: Mon, 25 Apr 2022 00:13:47 -0400 (EDT)

branch: master
commit 45372fb1f4862a94b57dee2c5ac0cc870d589de4
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    * src/nsfns.m (Fns_list_colors): Fix autoreleasing.
---
 src/nsfns.m | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/nsfns.m b/src/nsfns.m
index 720ed3f88e..f3dc235b89 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -2103,6 +2103,7 @@ The optional argument FRAME is currently ignored.  */)
   Lisp_Object list = Qnil;
   NSEnumerator *colorlists;
   NSColorList *clist;
+  NSAutoreleasePool *pool;
 
   if (!NILP (frame))
     {
@@ -2112,7 +2113,9 @@ The optional argument FRAME is currently ignored.  */)
     }
 
   block_input ();
-
+  /* This can be called during dumping, so we need to set up a
+     temporary autorelease pool.  */
+  pool = [[NSAutoreleasePool alloc] init];
   colorlists = [[NSColorList availableColorLists] objectEnumerator];
   while ((clist = [colorlists nextObject]))
     {
@@ -2123,12 +2126,9 @@ The optional argument FRAME is currently ignored.  */)
           NSString *cname;
           while ((cname = [cnames nextObject]))
             list = Fcons ([cname lispString], list);
-/*           for (i = [[clist allKeys] count] - 1; i >= 0; i--)
-               list = Fcons (build_string ([[[clist allKeys] objectAtIndex: i]
-                                             UTF8String]), list); */
         }
     }
-
+  [pool release];
   unblock_input ();
 
   return list;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]