From 21922bca9a27082781e2ae4140c05fe60008a66c Mon Sep 17 00:00:00 2001 From: Junkyeong Kim Date: Thu, 16 Feb 2017 13:19:17 +0900 Subject: [PATCH] set null after display_wrapper free Change-Id: Ie4d6257d9c6079b3e58e98e701775d3b140638c6 Signed-off-by: Junkyeong Kim --- src/efl_util.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/efl_util.c b/src/efl_util.c index 897d291..95d0874 100644 --- a/src/efl_util.c +++ b/src/efl_util.c @@ -308,6 +308,7 @@ _wl_init(void) reg = wl_display_get_registry(display_wrapper); wl_proxy_wrapper_destroy(display_wrapper); + display_wrapper = NULL; EINA_SAFETY_ON_NULL_GOTO(reg, fail); wl_registry_add_listener(reg, &_wl_reg_listener, NULL); @@ -1558,15 +1559,16 @@ efl_util_screenshot_initialize(int width, int height) wl_display_roundtrip_queue(_eflutil.wl.dpy, _eflutil.wl.queue); display_wrapper = wl_proxy_create_wrapper(_eflutil.wl.dpy); - EINA_SAFETY_ON_NULL_GOTO(display_wrapper, fail_init); + EINA_SAFETY_ON_NULL_GOTO(display_wrapper, fail_memory); _eflutil.wl.shot.queue = wl_display_create_queue(_eflutil.wl.dpy); - EINA_SAFETY_ON_NULL_GOTO(_eflutil.wl.shot.queue, fail_init); + EINA_SAFETY_ON_NULL_GOTO(_eflutil.wl.shot.queue, fail_memory); wl_proxy_set_queue((struct wl_proxy *)display_wrapper, _eflutil.wl.shot.queue); reg = wl_display_get_registry(display_wrapper); wl_proxy_wrapper_destroy(display_wrapper); + display_wrapper = NULL; EINA_SAFETY_ON_NULL_GOTO(reg, fail_init); wl_registry_add_listener(reg, &_wl_reg_screenshooter_listener, NULL); @@ -1627,15 +1629,13 @@ fail_memory: wl_proxy_wrapper_destroy(display_wrapper); set_last_result(EFL_UTIL_ERROR_OUT_OF_MEMORY); return NULL; -/* LCOV_EXCL_STOP */ fail_init: if (screenshot) efl_util_screenshot_deinitialize(screenshot); _screenshot_mutex_unlock(); - if (display_wrapper) - wl_proxy_wrapper_destroy(display_wrapper); set_last_result(EFL_UTIL_ERROR_SCREENSHOT_INIT_FAIL); return NULL; +/* LCOV_EXCL_STOP */ } API int -- 2.7.4