From e58291b266335a85490253e04ce31fbe5e27b466 Mon Sep 17 00:00:00 2001 From: Milan Toth Date: Tue, 22 Nov 2022 12:13:14 +0000 Subject: [PATCH] cleanup --- src/kinetic_ui/ku_connector_wayland.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/kinetic_ui/ku_connector_wayland.c b/src/kinetic_ui/ku_connector_wayland.c index 4566a24..688403f 100644 --- a/src/kinetic_ui/ku_connector_wayland.c +++ b/src/kinetic_ui/ku_connector_wayland.c @@ -1462,6 +1462,7 @@ static void ku_wayland_handle_global( if (strcmp(interface, wl_compositor_interface.name) == 0) { + /* TODO LEAKS!!! */ wlc.compositor = wl_registry_bind(registry, name, &wl_compositor_interface, 4); } else if (strcmp(interface, wl_seat_interface.name) == 0) @@ -1529,7 +1530,7 @@ static void ku_wayland_handle_global( static void ku_wayland_handle_global_remove(void* data, struct wl_registry* registry, uint32_t name) { - /* mt_log_debug("handle global remove"); */ + mt_log_debug("handle global remove"); } static const struct wl_registry_listener registry_listener = @@ -1662,9 +1663,11 @@ void ku_wayland_init( } else mt_log_error("compositor not found"); + for (int m = 0; m < wlc.monitor_count; m++) free(wlc.monitors[m]); + for (int w = 0; w < wlc.monitor_count; w++) free(wlc.windows[w]); + wl_surface_destroy(wlc.cursor_surface); - if (wlc.cursor_theme) - wl_cursor_theme_destroy(wlc.cursor_theme); + if (wlc.cursor_theme) wl_cursor_theme_destroy(wlc.cursor_theme); wl_compositor_destroy(wlc.compositor); @@ -1672,8 +1675,6 @@ void ku_wayland_init( } else mt_log_debug("cannot open display"); - REL(wlc.windows[0]); - REL(wlc.monitors); REL(wlc.windows); }