]> git.sur5r.net Git - i3/i3/commitdiff
x.c: correctly free con->frame_buffer in _x_con_kill stapelberg-patch-1 3637/head
authorMichael Stapelberg <stapelberg@users.noreply.github.com>
Thu, 7 Mar 2019 13:58:53 +0000 (14:58 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Tue, 19 Mar 2019 08:50:22 +0000 (09:50 +0100)
This fixes a crash which I could not reproduce in a testcase with reasonable effort, but the user reported the fix works.

Compare with src/x.c:946.

fixes #3554
fixes #3645

src/x.c

diff --git a/src/x.c b/src/x.c
index f643a9b33def33b99b6255aecb8b7d79899ba886..e6d875e50775f99ba145a3749cad125908c6181c 100644 (file)
--- a/src/x.c
+++ b/src/x.c
@@ -268,6 +268,7 @@ static void _x_con_kill(Con *con) {
     draw_util_surface_free(conn, &(con->frame));
     draw_util_surface_free(conn, &(con->frame_buffer));
     xcb_free_pixmap(conn, con->frame_buffer.id);
+    con->frame_buffer.id = XCB_NONE;
     state = state_for_frame(con->frame.id);
     CIRCLEQ_REMOVE(&state_head, state, state);
     CIRCLEQ_REMOVE(&old_state_head, state, old_state);