EDBus_Pending *p;
Eina_Iterator *iter;
EDBus_Connection_Name *cn;
+ Eina_Array *cns;
DBG("Connection %p: unref (currently at %d refs)",
conn, conn->refcount);
EINA_INLIST_FOREACH_SAFE(conn->pendings, list, p)
edbus_pending_cancel(p);
+ cns = eina_array_new(eina_hash_population(conn->names));
iter = eina_hash_iterator_data_new(conn->names);
EINA_ITERATOR_FOREACH(iter, cn)
{
cn->event_handlers.list = eina_inlist_remove(cn->event_handlers.list,
cn->event_handlers.list);
free(ctx);
- }
- edbus_connection_name_gc(conn, cn);
+ }
+ eina_array_push(cns, cn);
}
eina_iterator_free(iter);
+
+ while ((cn = eina_array_pop(cns)))
+ edbus_connection_name_gc(conn, cn);
+
eina_hash_free(conn->names);
+ eina_array_free(cns);
conn->refcount = 0;