wl_resource was use the wl_priv_signal for destroy signal from new version of wayland.
unlike the wl_signal, the link of signal should be removed in the destory callback function.
If not, it could the cause of memory crash when instance of link was freed without unlink
in the destroy callback.
Change-Id: Id98e0c6262adbf6c9b3df6f272ab11a199cefb4c
E_Comp_Object *cw;
cw = container_of(listener, E_Comp_Object, buffer_destroy_listener);
- cw->buffer_destroy_listener.notify = NULL;
+ if (cw->buffer_destroy_listener.notify)
+ {
+ cw->buffer_destroy_listener.notify = NULL;
+ wl_list_remove(&cw->buffer_destroy_listener.link);
+ }
+
if (e_object_is_del(E_OBJECT(cw->ec)))
{
if (!e_object_delay_del_ref_get(E_OBJECT(cw->ec)))
remote_surface = container_of(listener, E_Comp_Wl_Remote_Surface, tbm_destroy_listener);
if (!remote_surface) return;
+ if (remote_surface->tbm_destroy_listener.notify)
+ {
+ wl_list_remove(&remote_surface->tbm_destroy_listener.link);
+ remote_surface->tbm_destroy_listener.notify = NULL;
+ }
+
remote_surface->wl_tbm = NULL;
}
remote_buffer = container_of(listener, E_Comp_Wl_Remote_Buffer, destroy_listener);
if (!remote_buffer) return;
+ if (remote_buffer->destroy_listener.notify)
+ {
+ wl_list_remove(&remote_buffer->destroy_listener.link);
+ remote_buffer->destroy_listener.notify = NULL;
+ }
+
e_comp_wl_buffer_reference(&remote_buffer->ref, NULL);
free(remote_buffer);
}
if (!cres)
return;
+ if (cres->destroy_listener.notify)
+ {
+ wl_list_remove(&cres->destroy_listener.link);
+ cres->destroy_listener.notify = NULL;
+ }
DBG("Destroy Wl Resource res %p owner %s(%p)",
cres->res, cres->cfc->ec->icccm.name ? cres->cfc->ec->icccm.name : "", cres->cfc->ec);
E_Policy_Wl_Tzsh_Region *tzsh_reg;
tzsh_reg = container_of(listener, E_Policy_Wl_Tzsh_Region, destroy_listener);
+ if (tzsh_reg->destroy_listener.notify)
+ {
+ wl_list_remove(&tzsh_reg->destroy_listener.link);
+ tzsh_reg->destroy_listener.notify = NULL;
+ }
if (tzsh_reg->res_tzsh_reg)
{