summaryrefslogtreecommitdiff
path: root/plugins/push-notification.c
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2010-11-01 10:13:59 -0500
committerDenis Kenzior <denkenz@gmail.com>2010-11-02 12:15:53 -0500
commitf9066be4f0bd9d59f9c88d42b266baa1480b33a7 (patch)
tree46a61c4a195472439f61ddad29fc33fe1c56120d /plugins/push-notification.c
parent853f449892419436cee697f0e647679f3c79ba80 (diff)
downloadofono-f9066be4f0bd9d59f9c88d42b266baa1480b33a7.tar.gz
push-notification: Free agent when sms atom exits
Diffstat (limited to 'plugins/push-notification.c')
-rw-r--r--plugins/push-notification.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/push-notification.c b/plugins/push-notification.c
index 025bb752..30f36306 100644
--- a/plugins/push-notification.c
+++ b/plugins/push-notification.c
@@ -119,6 +119,12 @@ static void push_notification_cleanup(gpointer user)
struct push_notification *pn = user;
DBG("%p", pn);
+
+ pn->sms = NULL;
+
+ sms_agent_free(pn->agent);
+
+ ofono_modem_remove_interface(pn->modem, PUSH_NOTIFICATION_INTERFACE);
}
static void sms_watch(struct ofono_atom *atom,
@@ -129,15 +135,9 @@ static void sms_watch(struct ofono_atom *atom,
DBusConnection *conn = ofono_dbus_get_connection();
if (cond == OFONO_ATOM_WATCH_CONDITION_UNREGISTERED) {
- DBG("unregistered");
- pn->sms = NULL;
-
g_dbus_unregister_interface(conn,
ofono_modem_get_path(pn->modem),
PUSH_NOTIFICATION_INTERFACE);
-
- ofono_modem_remove_interface(pn->modem,
- PUSH_NOTIFICATION_INTERFACE);
return;
}