From fe10889ec7c16ab8b34a37730a5ddda160ab3f24 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 20 Oct 2015 17:51:22 -0400 Subject: [PATCH] ecore-wayland: plug some trivial leaks --- src/lib/ecore_wayland/ecore_wl.c | 4 +++- src/lib/ecore_wayland/ecore_wl_input.c | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/ecore_wayland/ecore_wl.c b/src/lib/ecore_wayland/ecore_wl.c index 8d020cd..f6e7109 100644 --- a/src/lib/ecore_wayland/ecore_wl.c +++ b/src/lib/ecore_wayland/ecore_wl.c @@ -554,6 +554,8 @@ _ecore_wl_shutdown(Eina_Bool close) wl_compositor_destroy(_ecore_wl_disp->wl.compositor); if (_ecore_wl_disp->wl.subcompositor) wl_subcompositor_destroy(_ecore_wl_disp->wl.subcompositor); + if (_ecore_wl_disp->cursor_theme) + wl_cursor_theme_destroy(_ecore_wl_disp->cursor_theme); if (_ecore_wl_disp->wl.display) { wl_registry_destroy(_ecore_wl_disp->wl.registry); @@ -727,7 +729,7 @@ _ecore_wl_cb_handle_global(void *data, struct wl_registry *registry, unsigned in if (ewd->input) _ecore_wl_input_setup(ewd->input); - else + else if (!ewd->cursor_theme) { ewd->cursor_theme = wl_cursor_theme_load(NULL, ECORE_WL_DEFAULT_CURSOR_SIZE, diff --git a/src/lib/ecore_wayland/ecore_wl_input.c b/src/lib/ecore_wayland/ecore_wl_input.c index 9bdd932..f189235 100644 --- a/src/lib/ecore_wayland/ecore_wl_input.c +++ b/src/lib/ecore_wayland/ecore_wl_input.c @@ -224,6 +224,8 @@ ecore_wl_input_cursor_size_set(Ecore_Wl_Input *input, const int size) EINA_SAFETY_ON_NULL_RETURN(input->display->wl.shm); + if (input->display->cursor_theme) + wl_cursor_theme_destroy(input->display->cursor_theme); input->display->cursor_theme = wl_cursor_theme_load(NULL, input->cursor_size, input->display->wl.shm); } @@ -239,6 +241,8 @@ ecore_wl_input_cursor_theme_name_set(Ecore_Wl_Input *input, const char *cursor_t EINA_SAFETY_ON_NULL_RETURN(input->display->wl.shm); + if (input->display->cursor_theme) + wl_cursor_theme_destroy(input->display->cursor_theme); input->display->cursor_theme = wl_cursor_theme_load(input->cursor_theme_name, input->cursor_size, input->display->wl.shm); -- 2.7.4