zehortigoza pushed a commit to branch master.
commit b17a4ecd482a3bc16414446f0e321f3c1fb16bad
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_core.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/src/lib/eldbus_core.c b/src/lib/eldbus_core.c
index 3c8217f..c663309 100644
--- a/src/lib/eldbus_core.c
+++ b/src/lib/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)
{
--
------------------------------------------------------------------------------
Get your SQL database under version control now!
Version control is standard for application code, but databases havent
caught up. So what steps can you take to put your SQL databases under
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk