Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i3bar leaks X graphic context #1172

Closed
i3bot opened this issue Feb 2, 2014 · 1 comment
Closed

i3bar leaks X graphic context #1172

i3bot opened this issue Feb 2, 2014 · 1 comment
Assignees
Labels

Comments

@i3bot
Copy link

i3bot commented Feb 2, 2014

[Originally reported by i3-new-ticket]
(In file i3/i3bar/src/xcb.c, current git, around line 1450, there is code

statusline_ctx = xcb_generate_id(xcb_connection);
xcb_free_gc(xcb_connection, statusline_ctx);
xcb_void_cookie_t sl_ctx_cookie = xcb_create_gc_checked(
    xcb_connection,
    statusline_ctx,xcb_root,
    mask,
    vals);

The order of generating new id and freeing old GC is seems wrong to me, they need to be swapped.

xcb_free_gc(xcb_connection, statusline_ctx);
statusline_ctx = xcb_generate_id(xcb_connection);
xcb_void_cookie_t sl_ctx_cookie = xcb_create_gc_checked(
    xcb_connection,
    statusline_ctx,xcb_root,
    mask,
    vals);
@stapelberg
Copy link
Member

This ticket was fixed in commit http://c.i3wm.org/f891a8a9:

i3bar: fix resource leak: statusline_ctx needs to be freed first

In practice this is rarely noticeable, unless you very often switch
screen resolutions, I think.

fixes #1172

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants