e_hwc_windows: check the list_count before destroy the list 35/194035/1
authorSooChan Lim <sc1.lim@samsung.com>
Tue, 27 Nov 2018 01:24:38 +0000 (10:24 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Wed, 28 Nov 2018 10:34:04 +0000 (19:34 +0900)
Change-Id: I833f4e9700255648633c83aa8ce795c8582d4445

src/bin/e_hwc_window.c
src/bin/e_hwc_windows.c

index a664cfc6ff3387598d1d6c97cbf1885ac2efa34a..8eda898cfe47647180df0144d0616ae3048e1e64 100644 (file)
@@ -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;
index bfef39b2b48f0e1993f81022f3b9448abb379655..07201c03718a4025e7f4d68b2b6073c0db481ad5 100644 (file)
@@ -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);