e_comp_wl: check ec->comp_data in focus in timer 63/220763/2
authorjeon <jhyuni.kang@samsung.com>
Mon, 23 Dec 2019 05:38:22 +0000 (14:38 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Mon, 23 Dec 2019 07:56:19 +0000 (07:56 +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 1f78d00a53e5a81b0529e1cdb3a789785bb6bc81..376ba4e2a9fd37c5f9d2c2d9dacef4e305ea1740 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;
 
@@ -3504,6 +3506,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();