e_comp_wl: check ec->comp_data in focus in timer 64/220764/1
authorjeon <jhyuni.kang@samsung.com>
Mon, 23 Dec 2019 05:38:22 +0000 (14:38 +0900)
committerJeongHyun Kang <jhyuni.kang@samsung.com>
Mon, 23 Dec 2019 05:40:41 +0000 (05:40 +0000)
  - sometimes ec is not deleted but ec->comp_data is NULL,
  - so add check conditions.
  - and E_EVENT_HOOK_DEL is called before free ec->comp_data,
  - so cancel and free focus in timer in this hook.

Change-Id: Ia19bad56dd4f91e7c6eeb8f0eb02f03599366e8f

src/bin/e_comp_wl.c

index 6c2b72f5b8484ad1bbec0a89eb924be6e8b36b2e..4939b1d43a766f6354399b40688d3547a178f89c 100644 (file)
@@ -1613,7 +1613,9 @@ _e_comp_wl_evas_cb_focus_in_timer(E_Client *ec)
    Eina_List *l;
    double t;
 
+   if (!ec) return EINA_FALSE;
    if (e_object_is_del(E_OBJECT(ec))) return EINA_FALSE;
+   if (!ec->comp_data) return EINA_FALSE;
 
    ec->comp_data->on_focus_timer = NULL;
 
@@ -3492,6 +3494,8 @@ _e_comp_wl_client_cb_del(void *data EINA_UNUSED, E_Client *ec)
 
    e_pixmap_cdata_set(ec->pixmap, NULL);
 
+   E_FREE_FUNC(ec->comp_data->on_focus_timer, ecore_timer_del);
+
    E_FREE(ec->comp_data);
 
    _e_comp_wl_focus_check();