mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-25 22:25:58 +01:00
x11 backend: fix various leaks
- xcb_query_pointer_reply return value needs to be freed - call XCloseDisplay - remove wl event_source
This commit is contained in:
parent
d9a3c66942
commit
b0c2bbebd1
1 changed files with 10 additions and 1 deletions
|
@ -143,6 +143,7 @@ static bool handle_x11_event(struct wlr_x11_backend *x11, xcb_generic_event_t *e
|
||||||
};
|
};
|
||||||
|
|
||||||
wlr_signal_emit_safe(&x11->pointer.events.motion_absolute, &abs);
|
wlr_signal_emit_safe(&x11->pointer.events.motion_absolute, &abs);
|
||||||
|
free(pointer);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case XCB_CLIENT_MESSAGE: {
|
case XCB_CLIENT_MESSAGE: {
|
||||||
|
@ -317,12 +318,20 @@ static void wlr_x11_backend_destroy(struct wlr_backend *backend) {
|
||||||
|
|
||||||
wlr_signal_emit_safe(&backend->events.destroy, backend);
|
wlr_signal_emit_safe(&backend->events.destroy, backend);
|
||||||
|
|
||||||
|
if (x11->event_source) {
|
||||||
|
wl_event_source_remove(x11->event_source);
|
||||||
|
}
|
||||||
wl_list_remove(&x11->display_destroy.link);
|
wl_list_remove(&x11->display_destroy.link);
|
||||||
|
|
||||||
wl_event_source_remove(x11->frame_timer);
|
wl_event_source_remove(x11->frame_timer);
|
||||||
wlr_egl_finish(&x11->egl);
|
wlr_egl_finish(&x11->egl);
|
||||||
|
|
||||||
xcb_disconnect(x11->xcb_conn);
|
if (x11->xcb_conn) {
|
||||||
|
xcb_disconnect(x11->xcb_conn);
|
||||||
|
}
|
||||||
|
if (x11->xlib_conn) {
|
||||||
|
XCloseDisplay(x11->xlib_conn);
|
||||||
|
}
|
||||||
free(x11);
|
free(x11);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue