From: Chong Yidong Date: Sun, 31 Jan 2010 05:23:09 +0000 (-0500) Subject: * nsterm.m (ns_defined_color): Block input. Suggested by Mike X-Git-Tag: emacs-pretest-23.1.93~132^2 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c67d885b46ca59cc8fa5b2f38c5d84dcea2223bc;p=emacs.git * nsterm.m (ns_defined_color): Block input. Suggested by Mike (Bug#3605). --- diff --git a/src/ChangeLog b/src/ChangeLog index f27aed26bef..941c394f107 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-01-31 Chong Yidong + + * nsterm.m (ns_defined_color): Block input. Suggested by Mike + (Bug#3605). + 2010-01-31 David De La Harpe Golden * fileio.c (Frename_file): Correctly rename symlinks to diff --git a/src/nsterm.m b/src/nsterm.m index 3951fdc2e58..8f3233f9fde 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -1552,19 +1552,19 @@ ns_defined_color (struct frame *f, char *name, XColor *color_def, int alloc, Return 0 if not found -------------------------------------------------------------------------- */ { - NSColor *temp; - int notFound = ns_get_color (name, &temp); - + NSColor *col; NSTRACE (ns_defined_color); - if (notFound) - return 0; - + BLOCK_INPUT; + if (ns_get_color (name, &col) != 0) /* Color not found */ + { + UNBLOCK_INPUT; + return 0; + } if (makeIndex && alloc) - color_def->pixel = ns_index_color(temp, f); /* [temp retain]; */ - - ns_query_color (temp, color_def, !makeIndex); - + color_def->pixel = ns_index_color (col, f); + ns_query_color (col, color_def, !makeIndex); + UNBLOCK_INPUT; return 1; }