changeset 27963:0e2c6e5cca6e

(x_clear_image, x_kill_gs_process): Use x_free_colors.
author Gerd Moellmann <gerd@gnu.org>
date Thu, 02 Mar 2000 13:27:51 +0000
parents 048184bb751e
children c9d52e101c13
files src/xfns.c
diffstat 1 files changed, 4 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/src/xfns.c	Thu Mar 02 13:26:21 2000 +0000
+++ b/src/xfns.c	Thu Mar 02 13:27:51 2000 +0000
@@ -6093,21 +6093,9 @@
       
   if (img->ncolors)
     {
-      int class = FRAME_X_DISPLAY_INFO (f)->visual->class;
-      
-      /* If display has an immutable color map, freeing colors is not
-	 necessary and some servers don't allow it.  So don't do it.  */
-      if (class != StaticColor
-	  && class != StaticGray
-	  && class != TrueColor)
-	{
-	  Colormap cmap;
-	  BLOCK_INPUT;
-	  cmap = DefaultColormapOfScreen (FRAME_X_DISPLAY_INFO (f)->screen);
-	  XFreeColors (FRAME_X_DISPLAY (f), cmap, img->colors,
-		       img->ncolors, 0);
-	  UNBLOCK_INPUT;
-	}
+      BLOCK_INPUT;
+      x_free_colors (f, img->colors, img->ncolors);
+      UNBLOCK_INPUT;
       
       xfree (img->colors);
       img->colors = NULL;
@@ -9932,11 +9920,7 @@
 	     allocated colors on behalf of us.  So, to get the
 	     reference counts right, free them once.  */
 	  if (img->ncolors)
-	    {
-	      Colormap cmap = DefaultColormapOfScreen (FRAME_X_SCREEN (f));
-	      XFreeColors (FRAME_X_DISPLAY (f), cmap,
-			   img->colors, img->ncolors, 0);
-	    }
+	    x_free_colors (f, img->colors, img->ncolors);
 #endif
 	}
       else