Fix some memory leaks

Not really noticeable when using it once since it's such a short-lived
program, but with "-r0" it can add up over time.

There may be other leaks, need to check/test to be sure (but valgrind
doesn't report any).

See: #17
pull/19/head
Martin Tournoij 4 years ago
parent e2b8ae35da
commit 27f1a9699b
No known key found for this signature in database
GPG Key ID: A6258419189EE585

@ -179,6 +179,7 @@ void cursor_center(Display *display, int size, int *x, int *y) {
XFixesCursorImage *c = XFixesGetCursorImage(display);
*x = c->x - size/2 - c->width/2 + c->xhot;
*y = c->y - size/2 - c->height/2 + c->yhot;
XFree(c);
}
void draw(char *name, Display *display, int screen,
@ -233,6 +234,7 @@ void draw(char *name, Display *display, int screen,
0, 0, // x, y position
size, size, // Size
0, 360 * 64); // Make it a full circle
XFreeGC(display, part_shape);
XShapeCombineMask(display, window, ShapeBounding, 0, 0, shape_mask, ShapeSet);
XShapeCombineMask(display, window, ShapeClip, 0, 0, shape_mask, ShapeSet);

Loading…
Cancel
Save