# HG changeset patch # User Gerd Moellmann # Date 952003671 0 # Node ID 0e2c6e5cca6ee9930c0b1c1d6af38eba5128312c # Parent 048184bb751e24f12650a619fd68469b6ac8ba87 (x_clear_image, x_kill_gs_process): Use x_free_colors. diff -r 048184bb751e -r 0e2c6e5cca6e src/xfns.c --- 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