]> git.sur5r.net Git - i3/i3/commitdiff
i3bar: fix resource leak: statusline_ctx needs to be freed first
authorMichael Stapelberg <michael@stapelberg.de>
Sun, 2 Feb 2014 10:22:42 +0000 (11:22 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Sun, 2 Feb 2014 10:24:17 +0000 (11:24 +0100)
In practice this is rarely noticeable, unless you very often switch
screen resolutions, I think.

fixes #1172

i3bar/src/xcb.c

index f3eaa54745c6bf3129cdac610023cde3f99ef2ac..928771d8d214d0488f3bbd8e4c968b07f311ba0b 100644 (file)
@@ -1395,8 +1395,8 @@ void realloc_sl_buffer(void) {
 
     mask |= XCB_GC_BACKGROUND;
     vals[0] = colors.bar_fg;
-    statusline_ctx = xcb_generate_id(xcb_connection);
     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,