tzsh = E_NEW(E_Policy_Wl_Tzsh, 1);
EINA_SAFETY_ON_NULL_RETURN_VAL(tzsh, NULL);
+ ELOGF("TZSH", "NEW tzsh:%p, res_tzsh:%p", NULL, tzsh, res_tzsh);
+
tzsh->res_tzsh = res_tzsh;
polwl->tzshs = eina_list_append(polwl->tzshs, tzsh);
polwl->tzshs = eina_list_remove(polwl->tzshs, tzsh);
+ EINA_LIST_FOREACH_SAFE(polwl->tzsh_srvs, l, ll, tzsh_srv)
+ {
+ if (tzsh_srv->tzsh != tzsh) continue;
+ _e_policy_wl_tzsh_srv_del(tzsh_srv);
+ }
+
if (tzsh->service_list)
{
- EINA_LIST_FREE(tzsh->service_list, tzsh_srv)
+ EINA_LIST_FOREACH_SAFE(tzsh->service_list, l, ll, tzsh_srv)
{
- EINA_LIST_FOREACH_SAFE(polwl->tzsh_srvs, l, ll, tzsh_srv)
- {
- if (tzsh_srv->tzsh != tzsh) continue;
- _e_policy_wl_tzsh_srv_del(tzsh_srv);
- break;
- }
+ _e_policy_wl_tzsh_srv_del(tzsh_srv);
}
+ eina_list_free(tzsh->service_list);
tzsh->service_list = NULL;
}
+ EINA_LIST_FOREACH_SAFE(polwl->tzsh_clients, l, ll, tzsh_client)
+ {
+ if (tzsh_client->tzsh != tzsh) continue;
+ _e_policy_wl_tzsh_client_del(tzsh_client);
+ }
+
if (tzsh->client_list)
{
- EINA_LIST_FREE(tzsh->client_list, tzsh_client)
+ EINA_LIST_FOREACH_SAFE(tzsh->client_list, l, ll, tzsh_client)
{
- EINA_LIST_FOREACH_SAFE(polwl->tzsh_clients, l, ll, tzsh_client)
- {
- if (tzsh_client->tzsh != tzsh) continue;
- _e_policy_wl_tzsh_client_del(tzsh_client);
- break;
- }
+ _e_policy_wl_tzsh_client_del(tzsh_client);
}
+ eina_list_free(tzsh->client_list);
+ tzsh->client_list = NULL;
}
#ifdef TZSH_DEBUG
_print_tzsh_client_info();
#endif
+ ELOGF("TZSH", "FREE tzsh:%p", NULL, tzsh);
+
memset(tzsh, 0x0, sizeof(E_Policy_Wl_Tzsh));
E_FREE(tzsh);
}
polwl->srvs[role] = tzsh_srv;
polwl->tzsh_srvs = eina_list_append(polwl->tzsh_srvs, tzsh_srv);
+ ELOGF("TZSH", "CREATE tzsh_srv:%p, res_tzsh_srv:%p", ec, tzsh_srv, res_tzsh_srv);
+
#ifdef TZSH_DEBUG
_print_tzsh_service_info();
#endif
_print_tzsh_service_info();
#endif
- if (tzsh_srv->tzsh)
+ if (tzsh_srv->tzsh && tzsh_srv->tzsh->service_list)
tzsh_srv->tzsh->service_list = eina_list_remove(tzsh_srv->tzsh->service_list, tzsh_srv);
if (polwl->srvs[tzsh_srv->role] == tzsh_srv)
}
}
+ ELOGF("TZSH", "FREE tzsh_srv:%p", tzsh_srv->ec, tzsh_srv);
+
if (tzsh_srv->ec)
{
e_object_unref(E_OBJECT(tzsh_srv->ec));
tzsh_srv->ec = NULL;
}
+
+ if (tzsh_srv->res_tzsh_srv)
+ wl_resource_set_user_data(tzsh_srv->res_tzsh_srv, NULL);
+
memset(tzsh_srv, 0x0, sizeof(E_Policy_Wl_Tzsh_Srv));
E_FREE(tzsh_srv);
}
E_FREE_LIST(tzsh_client->events, ecore_event_handler_del);
- if (tzsh_client->tzsh)
- tzsh_client->tzsh->service_list = eina_list_remove(tzsh_client->tzsh->service_list, tzsh_client);
+ if (tzsh_client->tzsh && tzsh_client->tzsh->client_list)
+ tzsh_client->tzsh->client_list = eina_list_remove(tzsh_client->tzsh->client_list, tzsh_client);
if (!eina_list_data_find(polwl->tzsh_clients, tzsh_client))
return;