Fix color leak
* src/xterm.c (x_alloc_nearest_color_1): Don't allocate colors multiple times when searching for a closest match.
This commit is contained in:
parent
8b66adfe06
commit
f2b58db280
1 changed files with 2 additions and 6 deletions
|
@ -3882,12 +3882,8 @@ x_alloc_nearest_color_1 (Display *dpy, Colormap cmap, XColor *color)
|
|||
temp.red = cells[x].red;
|
||||
temp.green = cells[x].green;
|
||||
temp.blue = cells[x].blue;
|
||||
status = XAllocColor (dpy, cmap, &temp);
|
||||
if (status)
|
||||
{
|
||||
nearest = x;
|
||||
nearest_delta = trial_delta;
|
||||
}
|
||||
nearest = x;
|
||||
nearest_delta = trial_delta;
|
||||
}
|
||||
}
|
||||
color->red = cells[nearest].red;
|
||||
|
|
Loading…
Add table
Reference in a new issue