From: Po Lu Date: Mon, 25 Apr 2022 04:13:22 +0000 (+0800) Subject: * src/nsfns.m (Fns_list_colors): Fix autoreleasing. X-Git-Tag: emacs-29.0.90~1931^2~322 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=45372fb1f4862a94b57dee2c5ac0cc870d589de4;p=emacs.git * src/nsfns.m (Fns_list_colors): Fix autoreleasing. --- diff --git a/src/nsfns.m b/src/nsfns.m index 720ed3f88e5..f3dc235b893 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;