forked from enlightenment/efl
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) <eduardo.lima@intel.com>
This commit is contained in:
parent
fb0dc85bc3
commit
1ac40b5502
|
@ -1024,7 +1024,7 @@ eldbus_connection_ref(Eldbus_Connection *conn)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_eldbus_connection_unref(Eldbus_Connection *conn)
|
_eldbus_connection_free(Eldbus_Connection *conn)
|
||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
Eldbus_Handler_Data *fd_handler;
|
Eldbus_Handler_Data *fd_handler;
|
||||||
|
@ -1037,11 +1037,6 @@ _eldbus_connection_unref(Eldbus_Connection *conn)
|
||||||
Eina_Array *cns;
|
Eina_Array *cns;
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|
||||||
DBG("Connection %p: unref (currently at %d refs)",
|
|
||||||
conn, conn->refcount);
|
|
||||||
|
|
||||||
if (--conn->refcount > 0) return;
|
|
||||||
|
|
||||||
DBG("Freeing connection %p", conn);
|
DBG("Freeing connection %p", conn);
|
||||||
|
|
||||||
_eldbus_connection_event_callback_call
|
_eldbus_connection_event_callback_call
|
||||||
|
@ -1138,6 +1133,16 @@ _eldbus_connection_unref(Eldbus_Connection *conn)
|
||||||
free(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
|
EAPI void
|
||||||
eldbus_connection_unref(Eldbus_Connection *conn)
|
eldbus_connection_unref(Eldbus_Connection *conn)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue