From 02a8eddd8f838f70135eaaa8a5cc080c9fec335e Mon Sep 17 00:00:00 2001 From: Jukka Rissanen Date: Mon, 2 Mar 2015 16:19:07 +0200 Subject: [PATCH] agent: Release the agent when iwd quits Send Release command to agent and remove used resources when iwd exits. --- src/agent.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/agent.c b/src/agent.c index a8daa926..2329ec95 100644 --- a/src/agent.c +++ b/src/agent.c @@ -395,6 +395,13 @@ bool agent_setup(struct l_dbus_interface *interface) return true; } +static void release_agent(struct agent *agent) +{ + send_request(agent, "Release"); + + agent_free(agent); +} + bool agent_init(void) { return true; @@ -402,5 +409,8 @@ bool agent_init(void) void agent_exit(void) { - return; + if (!default_agent) + return; + + release_agent(default_agent); }