From: SooChan Lim Date: Tue, 27 Nov 2018 01:24:38 +0000 (+0900) Subject: e_hwc_windows: check the list_count before destroy the list X-Git-Tag: submit/tizen_5.0/20181129.110741~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1ab1f9dfb140d49fb40081724756d53d18cf833d;p=platform%2Fupstream%2Fenlightenment.git e_hwc_windows: check the list_count before destroy the list Change-Id: I833f4e9700255648633c83aa8ce795c8582d4445 --- diff --git a/src/bin/e_hwc_window.c b/src/bin/e_hwc_window.c index a664cfc6ff..8eda898cfe 100644 --- a/src/bin/e_hwc_window.c +++ b/src/bin/e_hwc_window.c @@ -242,8 +242,11 @@ _e_hwc_window_target_window_surface_data_free(void *data) Eina_List *ee_rendered_hw_list = (Eina_List *)data; E_Hwc_Window *hwc_window = NULL; - EINA_LIST_FREE(ee_rendered_hw_list, hwc_window) - e_object_unref(E_OBJECT(hwc_window)); + if (eina_list_count(ee_rendered_hw_list)) + { + EINA_LIST_FREE(ee_rendered_hw_list, hwc_window) + e_object_unref(E_OBJECT(hwc_window)); + } } /* gets called as somebody modifies target_window's queue */ @@ -321,8 +324,11 @@ _e_hwc_window_target_window_render_flush_post_cb(void *data, Evas *e EINA_UNUSED { WRN("flush_post_cb is called but tsurface isn't dequeued"); - EINA_LIST_FREE(target_hwc_window->ee_rendered_hw_list, hwc_window) - e_object_unref(E_OBJECT(hwc_window)); + if (eina_list_count(target_hwc_window->ee_rendered_hw_list)) + { + EINA_LIST_FREE(target_hwc_window->ee_rendered_hw_list, hwc_window) + e_object_unref(E_OBJECT(hwc_window)); + } target_hwc_window->ee_rendered_hw_list = NULL; return; diff --git a/src/bin/e_hwc_windows.c b/src/bin/e_hwc_windows.c index bfef39b2b4..07201c0371 100644 --- a/src/bin/e_hwc_windows.c +++ b/src/bin/e_hwc_windows.c @@ -1231,8 +1231,11 @@ _e_hwc_windows_visible_windows_update(E_Hwc *hwc) if (!_e_hwc_windows_visible_windows_changed_check(hwc, visible_windows, visible_num)) return EINA_FALSE; - EINA_LIST_FREE(hwc->visible_windows, hwc_window) - e_object_unref(E_OBJECT(hwc_window)); + if (eina_list_count(hwc->visible_windows)) + { + EINA_LIST_FREE(hwc->visible_windows, hwc_window) + e_object_unref(E_OBJECT(hwc_window)); + } /* store the current visible windows and the number of them */ hwc->visible_windows = eina_list_clone(visible_windows);