Commit 0d605c67 authored by Gerd Moellmann's avatar Gerd Moellmann
Browse files

(x_alloc_lighter_color, x_setup_relief_color): Use

x_free_colors.
parent 2ad412d7
...@@ -3261,15 +3261,7 @@ x_alloc_lighter_color (f, display, cmap, pixel, factor, delta) ...@@ -3261,15 +3261,7 @@ x_alloc_lighter_color (f, display, cmap, pixel, factor, delta)
{ {
/* If we end up with the same color as before, try adding /* If we end up with the same color as before, try adding
delta to the RGB values. */ delta to the RGB values. */
int class = FRAME_X_DISPLAY_INFO (f)->visual->class; x_free_colors (f, &new.pixel, 1);
/* 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)
XFreeColors (display, cmap, &new.pixel, 1, 0);
new.red = min (0xffff, delta + color.red); new.red = min (0xffff, delta + color.red);
new.green = min (0xffff, delta + color.green); new.green = min (0xffff, delta + color.green);
...@@ -3320,11 +3312,7 @@ x_setup_relief_color (f, relief, factor, delta, default_pixel) ...@@ -3320,11 +3312,7 @@ x_setup_relief_color (f, relief, factor, delta, default_pixel)
{ {
/* If display has an immutable color map, freeing colors is not /* If display has an immutable color map, freeing colors is not
necessary and some servers don't allow it. So don't do it. */ necessary and some servers don't allow it. So don't do it. */
int class = dpyinfo->visual->class; x_free_colors (f, &relief->pixel, 1);
if (class != StaticColor
&& class != StaticGray
&& class != TrueColor)
XFreeColors (dpy, cmap, &relief->pixel, 1, 0);
relief->allocated_p = 0; relief->allocated_p = 0;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment