Skip to content

Commit

Permalink
Fix memory leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
ianyfan committed Aug 15, 2018
1 parent d05e1f7 commit a7b51b2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ static void create_pointer(struct slurp_state *state,

static void destroy_pointer(struct slurp_pointer *pointer) {
wl_list_remove(&pointer->link);
wl_surface_destroy(pointer->cursor_surface);
wl_pointer_destroy(pointer->wl_pointer);
free(pointer);
}
Expand All @@ -144,6 +145,8 @@ static void seat_handle_capabilities(void *data, struct wl_seat *seat,
struct wl_pointer *wl_pointer = wl_seat_get_pointer(seat);
create_pointer(state, wl_pointer);
}

wl_seat_destroy(seat);
}

static const struct wl_seat_listener seat_listener = {
Expand Down Expand Up @@ -196,6 +199,7 @@ static void destroy_output(struct slurp_output *output) {
}
finish_buffer(&output->buffers[0]);
finish_buffer(&output->buffers[1]);
wl_cursor_theme_destroy(output->cursor_theme);
zwlr_layer_surface_v1_destroy(output->layer_surface);
wl_surface_destroy(output->surface);
wl_output_destroy(output->wl_output);
Expand Down

0 comments on commit a7b51b2

Please sign in to comment.