etrunko pushed a commit to branch master.

commit 1ac40b550240a12e98995ac2a335545f8bf310a4
Author: Eduardo Lima (Etrunko) <[email protected]>
Date:   Thu May 23 16:36:29 2013 -0300

    eldbus: New internal function _eldbus_connection_free()
    
    This is actually a split on the _eldbus_connection_unref() function, that
    will be called either when the refcount reaches 0 or to force the deletion
    of an Eldus_Connection.
    
    The second use case will be contemplated in a following patch.
    
    Signed-off-by: Eduardo Lima (Etrunko) <[email protected]>
---
 src/lib/eldbus/eldbus_core.c | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/src/lib/eldbus/eldbus_core.c b/src/lib/eldbus/eldbus_core.c
index 3c8217f..c663309 100644
--- a/src/lib/eldbus/eldbus_core.c
+++ b/src/lib/eldbus/eldbus_core.c
@@ -1024,7 +1024,7 @@ eldbus_connection_ref(Eldbus_Connection *conn)
 }
 
 static void
-_eldbus_connection_unref(Eldbus_Connection *conn)
+_eldbus_connection_free(Eldbus_Connection *conn)
 {
    unsigned int i;
    Eldbus_Handler_Data *fd_handler;
@@ -1037,11 +1037,6 @@ _eldbus_connection_unref(Eldbus_Connection *conn)
    Eina_Array *cns;
    const char *name;
 
-   DBG("Connection %p: unref (currently at %d refs)",
-       conn, conn->refcount);
-
-   if (--conn->refcount > 0) return;
-
    DBG("Freeing connection %p", conn);
 
    _eldbus_connection_event_callback_call
@@ -1138,6 +1133,16 @@ _eldbus_connection_unref(Eldbus_Connection *conn)
    free(conn);
 }
 
+static void
+_eldbus_connection_unref(Eldbus_Connection *conn)
+{
+   DBG("Connection %p: unref (currently at %d refs)",
+       conn, conn->refcount);
+
+   if (--conn->refcount > 0) return;
+   _eldbus_connection_free(conn);
+}
+
 EAPI void
 eldbus_connection_unref(Eldbus_Connection *conn)
 {

-- 

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may

Reply via email to