From 2e432b6ca0308cd821245abfe26bbae151ac15e6 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Mon, 17 Aug 2009 15:55:48 -0500 Subject: [PATCH] Refactor ECC Support: Free in right spot The freeing of the emergency list should be in voicecalls_destroy function, where the rest of the datastructure is being freed --- src/voicecall.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/voicecall.c b/src/voicecall.c index 46768dc..5f5f263 100644 --- a/src/voicecall.c +++ b/src/voicecall.c @@ -506,6 +506,12 @@ static void voicecalls_destroy(gpointer userdata) calls->emit_en_source = 0; } + if (calls->en_list) { + g_slist_foreach(calls->en_list, (GFunc)g_free, NULL); + g_slist_free(calls->en_list); + calls->en_list = NULL; + } + for (l = calls->call_list; l; l = l->next) voicecall_dbus_unregister(modem, l->data); @@ -1822,13 +1828,6 @@ void ofono_voicecall_unregister(struct ofono_modem *modem) if (!modem->voicecalls) return; - l = modem->voicecalls->en_list; - if (l) { - g_slist_foreach(l, (GFunc)g_free, NULL); - g_slist_free(l); - l = NULL; - } - ofono_modem_remove_interface(modem, VOICECALL_MANAGER_INTERFACE); g_dbus_unregister_interface(conn, modem->path, VOICECALL_MANAGER_INTERFACE); -- 2.7.4