summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustavo F. Padovan <padovan@profusion.mobi>2012-01-14 18:00:56 -0200
committerDenis Kenzior <denkenz@gmail.com>2010-02-05 13:34:33 -0600
commitedb98c16e81cb0a12e8b1f259139ffc30a13e85b (patch)
tree1d1fb7f4a064bc3551cf86a6e071d2f8bad20e1c
parent4522c9686dd7e30f79cd6430623cb976555fa8ab (diff)
downloadofono-edb98c16e81cb0a12e8b1f259139ffc30a13e85b.tar.bz2
Fix: Don't call UnregisterAgent if already Released
Prevent to call UnregisterAgent on an already unregistered agent.
-rw-r--r--plugins/hfp.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/hfp.c b/plugins/hfp.c
index ee0c0738..c3826120 100644
--- a/plugins/hfp.c
+++ b/plugins/hfp.c
@@ -411,6 +411,9 @@ static DBusMessage *hfp_agent_release(DBusConnection *conn,
DBusMessage *msg, void *data)
{
struct ofono_modem *modem = data;
+ const char *obj_path = ofono_modem_get_path(modem);
+
+ g_dbus_unregister_interface(connection, obj_path, HFP_AGENT_INTERFACE);
ofono_modem_remove(modem);
@@ -757,8 +760,11 @@ static int hfp_probe(struct ofono_modem *modem)
static void hfp_remove(struct ofono_modem *modem)
{
struct hfp_data *data = ofono_modem_get_data(modem);
+ const char *obj_path = ofono_modem_get_path(modem);
- hfp_unregister_ofono_handsfree(modem);
+ if (g_dbus_unregister_interface(connection, obj_path,
+ HFP_AGENT_INTERFACE))
+ hfp_unregister_ofono_handsfree(modem);
g_hash_table_remove(uuid_hash, data->handsfree_path);