Merge pull request #4904 from akallabeth/floatbar_x11_leak

Fixed floatbar X11 leak.
This commit is contained in:
Martin Fleisz 2018-10-01 14:45:45 +02:00 committed by GitHub
commit 6554bc3b8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -204,6 +204,9 @@ xfFloatbar* xf_floatbar_new(xfContext* xfc, Window window)
xfFloatbar* floatbar;
XWindowAttributes attr;
int i, width;
if (!xfc)
return NULL;
floatbar = (xfFloatbar*) calloc(1, sizeof(xfFloatbar));
floatbar->locked = TRUE;
@ -299,6 +302,8 @@ static void xf_floatbar_event_expose(xfContext* xfc, XEvent* event)
XSetForeground(xfc->display, gc, xf_floatbar_get_color(xfc, FLOATBAR_COLOR_FOREGROUND));
XDrawString(xfc->display, floatbar->handle, gc, floatbar->width / 2 - len * 2, 15,
xfc->context.settings->ServerHostname, len);
XFreeGC(xfc->display, gc);
XFreeGC(xfc->display, shape_gc);
}
static xfFloatbarButton* xf_floatbar_get_button(xfContext* xfc, XEvent* event)