Fix X11 memoryleak for round corners

When using round corners, the shape_gc in x_win_round_corners never got
freed. This created a memory leak in x11 itself and let the X process
create more load while becoming sluggish in some situations.

From the docs, XFreeGC actually could return an int and could throw a
BadGC error. Neither of them are important to catch in our situation:

- Having a look into the Xlib sourcecode, XFreeGC returns always 1.
- As we don't overwrite the shape_gc or do any other destoying calls,
  the BadGC can't happen in this code.
This commit is contained in:
Benedikt Heine 2018-06-22 11:41:26 +02:00
parent a0f21f5c26
commit 0e5034b02a

View File

@ -141,6 +141,7 @@ static void x_win_round_corners(window_x11 *win, const int rad)
XShapeCombineMask(xctx.dpy, win->xwin, ShapeBounding, 0, 0, mask, ShapeSet); XShapeCombineMask(xctx.dpy, win->xwin, ShapeBounding, 0, 0, mask, ShapeSet);
XFreeGC(xctx.dpy, shape_gc);
XFreePixmap(xctx.dpy, mask); XFreePixmap(xctx.dpy, mask);
XShapeSelectInput(xctx.dpy, XShapeSelectInput(xctx.dpy,