Skip to content
This repository has been archived by the owner on Apr 18, 2023. It is now read-only.

Commit

Permalink
Fix memleaks by avoiding _checked variants when discarding the result
Browse files Browse the repository at this point in the history
Thanks psychon for pointing this out in
i3/i3#2450 (comment)!
  • Loading branch information
stapelberg committed Sep 14, 2016
1 parent 5594139 commit b850cfb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main.c
Expand Up @@ -826,7 +826,7 @@ int main(int argc, char *argv[]) {
(uint32_t[]){XCB_GX_COPY, ~0, XCB_FILL_STYLE_SOLID, XCB_SUBWINDOW_MODE_INCLUDE_INFERIORS});

xcb_copy_area(conn, root->root, pixmap, gc, 0, 0, 0, 0, width, height);
xcb_change_window_attributes_checked(conn, root->root, XCB_CW_BACK_PIXMAP, (uint32_t[]){pixmap});
xcb_change_window_attributes(conn, root->root, XCB_CW_BACK_PIXMAP, (uint32_t[]){pixmap});
xcb_flush(conn);
xcb_free_gc(conn, gc);
xcb_free_pixmap(conn, pixmap);
Expand Down
2 changes: 1 addition & 1 deletion src/x.c
Expand Up @@ -789,7 +789,7 @@ void x_push_node(Con *con) {
int width = MAX((int32_t)rect.width, 1);
int height = MAX((int32_t)rect.height, 1);

xcb_create_pixmap_checked(conn, win_depth, con->frame_buffer.id, con->frame.id, width, height);
xcb_create_pixmap(conn, win_depth, con->frame_buffer.id, con->frame.id, width, height);
draw_util_surface_init(conn, &(con->frame_buffer), con->frame_buffer.id,
get_visualtype_by_id(get_visualid_by_depth(win_depth)), width, height);

Expand Down

0 comments on commit b850cfb

Please sign in to comment.