From: Patrik Flykt Date: Mon, 3 Sep 2012 11:17:15 +0000 (+0300) Subject: agent: Always clean up and unref on agent shutdown X-Git-Tag: 1.7~40 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5891f4e0434017bfdb51e61a57ea077e14676149;p=platform%2Fupstream%2Fconnman.git agent: Always clean up and unref on agent shutdown --- diff --git a/src/agent.c b/src/agent.c index aff41dfe..db5ea136 100644 --- a/src/agent.c +++ b/src/agent.c @@ -957,19 +957,16 @@ void __connman_agent_cleanup(void) if (agent_watch > 0) g_dbus_remove_watch(connection, agent_watch); - if (agent_path == NULL) - return; - - message = dbus_message_new_method_call(agent_sender, agent_path, - CONNMAN_AGENT_INTERFACE, "Release"); - if (message == NULL) - return; - - dbus_message_set_no_reply(message, TRUE); - - g_dbus_send_message(connection, message); + if (agent_path != NULL) { + message = dbus_message_new_method_call(agent_sender, agent_path, + CONNMAN_AGENT_INTERFACE, "Release"); + if (message != NULL) { + dbus_message_set_no_reply(message, TRUE); + g_dbus_send_message(connection, message); + } - agent_free(); + agent_free(); + } dbus_connection_unref(connection); }