struct _E_Policy_Zone
{
E_Zone *zone;
+ Eina_Hash *clients_hash;
struct wl_listener client_add;
struct wl_listener has_ec;
zone_client = _e_policy_zone_private_client_new(policy_zone, ec);
EINA_SAFETY_ON_NULL_RETURN(zone_client);
+ eina_hash_add(policy_zone->clients_hash, &ec, zone_client);
_e_policy_zone_client_set(zone, ec);
_e_policy_zone_client_data_set(zone, ec);
wl_list_remove(&zone_client->client_eval_post_new_client.link);
wl_list_remove(&zone_client->client_destroy.link);
+ eina_hash_del_by_key(policy_zone->clients_hash, &ec);
+
E_FREE(zone_client);
}
policy_zone->zone = zone;
e_object_ref(E_OBJECT(zone));
+ policy_zone->clients_hash = eina_hash_pointer_new(NULL);
+
// events
wl_signal_init(&policy_zone->events.client_add);
wl_signal_init(&policy_zone->events.client_remove);
EINTERN void
e_policy_zone_del(E_Policy_Zone *policy_zone)
{
+ E_Policy_Zone_Private_Client *zone_client;
+ Eina_Iterator *it;
+
EINA_SAFETY_ON_NULL_RETURN(policy_zone);
e_object_unref(E_OBJECT(policy_zone->zone));
wl_list_remove(&policy_zone->zone_client_top_get.link);
wl_list_remove(&policy_zone->zone_destroy.link);
+ if (policy_zone->clients_hash)
+ {
+ it = eina_hash_iterator_data_new(policy_zone->clients_hash);
+ EINA_ITERATOR_FOREACH(it, zone_client)
+ {
+ if (!zone_client) continue;
+ _e_policy_zone_private_client_del(zone_client);
+ }
+ eina_hash_free(policy_zone->clients_hash);
+ }
+
E_FREE(policy_zone);
return;