edbus: no need for this auxiliary variables, and check refcount first
SVN revision: 81461
This commit is contained in:
parent
292534738a
commit
1cae2f1968
|
@ -372,14 +372,11 @@ edbus_data_del_all(Eina_Inlist **p_list)
|
||||||
static void
|
static void
|
||||||
edbus_connection_name_gc(EDBus_Connection *conn, EDBus_Connection_Name *cn)
|
edbus_connection_name_gc(EDBus_Connection *conn, EDBus_Connection_Name *cn)
|
||||||
{
|
{
|
||||||
Eina_Bool have_obj;
|
if (cn->refcount > 0)
|
||||||
Eina_Bool have_event_handlers;
|
return;
|
||||||
|
if (cn->objects && eina_hash_population(cn->objects) > 0)
|
||||||
if (!cn->objects) have_obj = EINA_FALSE;
|
return;
|
||||||
else have_obj = !!eina_hash_population(cn->objects);
|
if (cn->event_handlers.list != NULL)
|
||||||
have_event_handlers = cn->event_handlers.list != NULL;
|
|
||||||
|
|
||||||
if (have_obj || have_event_handlers || cn->refcount > 0)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
eina_hash_del(conn->names, cn->name, cn);
|
eina_hash_del(conn->names, cn->name, cn);
|
||||||
|
@ -461,8 +458,6 @@ edbus_connection_name_unref(EDBus_Connection *conn, EDBus_Connection_Name *cn)
|
||||||
EINA_SAFETY_ON_NULL_RETURN(cn);
|
EINA_SAFETY_ON_NULL_RETURN(cn);
|
||||||
|
|
||||||
cn->refcount--;
|
cn->refcount--;
|
||||||
|
|
||||||
if (cn->refcount > 0) return;
|
|
||||||
edbus_connection_name_gc(conn, cn);
|
edbus_connection_name_gc(conn, cn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue