diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2008-05-27 21:31:12 +0000 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2008-05-27 21:31:12 +0000 |
commit | 649448818704cd93136d55d33676ad80cb463224 (patch) | |
tree | c7671bf290adebc08cc40ad75c1b6e89a92cc9a0 /hcid/agent.c | |
parent | af457e55d1a46fbf3ecef32fc29e299ee4be21cf (diff) |
Use guint identifier for all name_listener operations
Diffstat (limited to 'hcid/agent.c')
-rw-r--r-- | hcid/agent.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/hcid/agent.c b/hcid/agent.c index 330d00e4..831f68b2 100644 --- a/hcid/agent.c +++ b/hcid/agent.c @@ -70,6 +70,7 @@ struct agent { guint timeout; agent_remove_cb remove_cb; void *remove_cb_data; + guint listener_id; }; struct agent_request { @@ -125,8 +126,10 @@ static void agent_request_free(struct agent_request *req) g_free(req); } -static void agent_exited(const char *name, struct agent *agent) +static void agent_exited(const char *name, void *user_data) { + struct agent *agent = user_data; + debug("Agent %s exited without calling Unregister", name); agent_destroy(agent, TRUE); @@ -169,8 +172,7 @@ static void agent_free(struct agent *agent) g_source_remove(agent->timeout); if (!agent->exited) { - name_listener_remove(connection, agent->name, - (name_cb_t) agent_exited, agent); + name_listener_id_remove(agent->listener_id); agent_release(agent); } @@ -215,7 +217,8 @@ struct agent *agent_create(struct adapter *adapter, const char *name, (GSourceFunc) agent_timeout, agent); } - name_listener_add(connection, name, (name_cb_t) agent_exited, agent); + agent->listener_id = name_listener_add(connection, name, agent_exited, + agent); return agent; } |