From 475d9ac770eae6d25b60fa2f2ab55e0698ac6dd0 Mon Sep 17 00:00:00 2001 From: Yu A Wang Date: Fri, 29 Jul 2011 23:02:56 -0400 Subject: [PATCH] ofono: Destroy network_hash when disconnecting --- plugins/ofono.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/plugins/ofono.c b/plugins/ofono.c index ea4692f..2bf777d 100644 --- a/plugins/ofono.c +++ b/plugins/ofono.c @@ -1596,12 +1596,15 @@ static void ofono_disconnect(DBusConnection *connection, void *user_data) { DBG("connection %p", connection); - if (modem_hash == NULL) - return; - - g_hash_table_destroy(modem_hash); + if (modem_hash != NULL) { + g_hash_table_destroy(modem_hash); + modem_hash = NULL; + } - modem_hash = NULL; + if (network_hash != NULL) { + g_hash_table_destroy(network_hash); + network_hash = NULL; + } } static gboolean modem_changed(DBusConnection *connection, DBusMessage *message, -- 2.7.4