From 45372fb1f4862a94b57dee2c5ac0cc870d589de4 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Mon, 25 Apr 2022 12:13:22 +0800 Subject: [PATCH] * 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 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; -- 2.39.2