]> code.delx.au - gnu-emacs/blobdiff - src/nsterm.m
* nsterm.m (ns_ring_bell): Revert last change (Bug#5569).
[gnu-emacs] / src / nsterm.m
index a102267920c382bb79b3dfacf7eee933004f8ce2..a4d06f82d9770c88a01b37d8e36107b86645e5d4 100644 (file)
@@ -1517,19 +1517,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;
 }