$OpenBSD: patch-i3bar_src_xcb_c,v 1.14 2014/02/03 09:54:17 dcoppa Exp $

commit a4d504485139dc9bf4c846c26a38968a920dfcb1
Author: Michael Stapelberg <michael@stapelberg.de>
Date:   Sun Feb 2 11:22:42 2014 +0100

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.

--- i3bar/src/xcb.c.orig	Thu Jan 23 22:52:24 2014
+++ i3bar/src/xcb.c	Mon Feb  3 10:46:27 2014
@@ -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,
