[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master f2b58db280: Fix color leak
From: |
Po Lu |
Subject: |
master f2b58db280: Fix color leak |
Date: |
Mon, 7 Mar 2022 06:55:48 -0500 (EST) |
branch: master
commit f2b58db280e28b1ec1607520ef706482e14f6a57
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
Fix color leak
* src/xterm.c (x_alloc_nearest_color_1): Don't allocate colors
multiple times when searching for a closest match.
---
src/xterm.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/src/xterm.c b/src/xterm.c
index 0432bd78c6..1befa97fd1 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -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;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master f2b58db280: Fix color leak,
Po Lu <=