From 4fa62be97fc97db59223fb9d10237812488da613 Mon Sep 17 00:00:00 2001 From: Junkyeong Kim Date: Mon, 18 Jun 2018 14:20:42 +0900 Subject: [PATCH] screenshot: destroy wl_registry when screenshot deinit Change-Id: Ib0c5b0bb802c26fd27055989ec71f19afad63b44 --- src/efl_util.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/efl_util.c b/src/efl_util.c index 72295c3..652aa1a 100644 --- a/src/efl_util.c +++ b/src/efl_util.c @@ -1802,6 +1802,9 @@ efl_util_screenshot_initialize(int width, int height) _eflutil.wl.shot.tbm_client = wayland_tbm_client_init(_eflutil.wl.dpy); EINA_SAFETY_ON_NULL_GOTO(_eflutil.wl.shot.tbm_client, fail_init); + + wl_registry_destroy(reg); + reg = NULL; } if (_eflutil.wl.shot.noti == 0) @@ -1852,6 +1855,8 @@ fail_memory: set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY); return NULL; fail_init: + if (reg) + wl_registry_destroy(reg); if (screenshot) efl_util_screenshot_deinitialize(screenshot); _screenshot_mutex_unlock(); @@ -1875,12 +1880,6 @@ efl_util_screenshot_deinitialize(efl_util_screenshot_h screenshot) free(screenshot); g_screenshot = NULL; - if (_eflutil.wl.shot.queue) - { - wl_event_queue_destroy(_eflutil.wl.shot.queue); - _eflutil.wl.shot.queue = NULL; - } - if (_eflutil.wl.shot.screenshooter) { screenshooter_destroy(_eflutil.wl.shot.screenshooter); @@ -1892,6 +1891,12 @@ efl_util_screenshot_deinitialize(efl_util_screenshot_h screenshot) _eflutil.wl.shot.tz_screenshooter = NULL; } + if (_eflutil.wl.shot.queue) + { + wl_event_queue_destroy(_eflutil.wl.shot.queue); + _eflutil.wl.shot.queue = NULL; + } + _screenshot_mutex_unlock(); _screenshot_mutex_destory(); -- 2.7.4