summaryrefslogtreecommitdiff
path: root/legacy/edbus/src/lib/edbus_core.c
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@profusion.mobi>2012-12-20 14:52:15 +0000
committerLucas De Marchi <lucas.demarchi@profusion.mobi>2012-12-20 14:52:15 +0000
commit1cae2f1968d2b3ec7ddd544d665da71b3cbdef40 (patch)
treee723cc907a9e9d36de3617245ef4fb03d0cb54b4 /legacy/edbus/src/lib/edbus_core.c
parent292534738a779ea6876e3995d50514fe38732399 (diff)
edbus: no need for this auxiliary variables, and check refcount first
SVN revision: 81461
Diffstat (limited to '')
-rw-r--r--legacy/edbus/src/lib/edbus_core.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/legacy/edbus/src/lib/edbus_core.c b/legacy/edbus/src/lib/edbus_core.c
index 0f90fe59ce..d9991037f3 100644
--- a/legacy/edbus/src/lib/edbus_core.c
+++ b/legacy/edbus/src/lib/edbus_core.c
@@ -372,14 +372,11 @@ edbus_data_del_all(Eina_Inlist **p_list)
372static void 372static void
373edbus_connection_name_gc(EDBus_Connection *conn, EDBus_Connection_Name *cn) 373edbus_connection_name_gc(EDBus_Connection *conn, EDBus_Connection_Name *cn)
374{ 374{
375 Eina_Bool have_obj; 375 if (cn->refcount > 0)
376 Eina_Bool have_event_handlers; 376 return;
377 377 if (cn->objects && eina_hash_population(cn->objects) > 0)
378 if (!cn->objects) have_obj = EINA_FALSE; 378 return;
379 else have_obj = !!eina_hash_population(cn->objects); 379 if (cn->event_handlers.list != NULL)
380 have_event_handlers = cn->event_handlers.list != NULL;
381
382 if (have_obj || have_event_handlers || cn->refcount > 0)
383 return; 380 return;
384 381
385 eina_hash_del(conn->names, cn->name, cn); 382 eina_hash_del(conn->names, cn->name, cn);
@@ -461,8 +458,6 @@ edbus_connection_name_unref(EDBus_Connection *conn, EDBus_Connection_Name *cn)
461 EINA_SAFETY_ON_NULL_RETURN(cn); 458 EINA_SAFETY_ON_NULL_RETURN(cn);
462 459
463 cn->refcount--; 460 cn->refcount--;
464
465 if (cn->refcount > 0) return;
466 edbus_connection_name_gc(conn, cn); 461 edbus_connection_name_gc(conn, cn);
467} 462}
468 463