diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/xfns.c | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/src/xfns.c b/src/xfns.c index d5e966ed6bc..7f61cb602a8 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -6093,21 +6093,9 @@ x_clear_image (f, img) | |||
| 6093 | 6093 | ||
| 6094 | if (img->ncolors) | 6094 | if (img->ncolors) |
| 6095 | { | 6095 | { |
| 6096 | int class = FRAME_X_DISPLAY_INFO (f)->visual->class; | 6096 | BLOCK_INPUT; |
| 6097 | 6097 | x_free_colors (f, img->colors, img->ncolors); | |
| 6098 | /* If display has an immutable color map, freeing colors is not | 6098 | UNBLOCK_INPUT; |
| 6099 | necessary and some servers don't allow it. So don't do it. */ | ||
| 6100 | if (class != StaticColor | ||
| 6101 | && class != StaticGray | ||
| 6102 | && class != TrueColor) | ||
| 6103 | { | ||
| 6104 | Colormap cmap; | ||
| 6105 | BLOCK_INPUT; | ||
| 6106 | cmap = DefaultColormapOfScreen (FRAME_X_DISPLAY_INFO (f)->screen); | ||
| 6107 | XFreeColors (FRAME_X_DISPLAY (f), cmap, img->colors, | ||
| 6108 | img->ncolors, 0); | ||
| 6109 | UNBLOCK_INPUT; | ||
| 6110 | } | ||
| 6111 | 6099 | ||
| 6112 | xfree (img->colors); | 6100 | xfree (img->colors); |
| 6113 | img->colors = NULL; | 6101 | img->colors = NULL; |
| @@ -9932,11 +9920,7 @@ x_kill_gs_process (pixmap, f) | |||
| 9932 | allocated colors on behalf of us. So, to get the | 9920 | allocated colors on behalf of us. So, to get the |
| 9933 | reference counts right, free them once. */ | 9921 | reference counts right, free them once. */ |
| 9934 | if (img->ncolors) | 9922 | if (img->ncolors) |
| 9935 | { | 9923 | x_free_colors (f, img->colors, img->ncolors); |
| 9936 | Colormap cmap = DefaultColormapOfScreen (FRAME_X_SCREEN (f)); | ||
| 9937 | XFreeColors (FRAME_X_DISPLAY (f), cmap, | ||
| 9938 | img->colors, img->ncolors, 0); | ||
| 9939 | } | ||
| 9940 | #endif | 9924 | #endif |
| 9941 | } | 9925 | } |
| 9942 | else | 9926 | else |