summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2009-08-17 15:55:48 -0500
committerDenis Kenzior <denkenz@gmail.com>2009-08-17 16:02:53 -0500
commit2e432b6ca0308cd821245abfe26bbae151ac15e6 (patch)
treefe7cf9a5e30069cd3d9a91d34335417c71b3b5b6
parent5a0d8709af7a18a66e4e74fc8b8dce9835c1d6f8 (diff)
downloadofono-2e432b6ca0308cd821245abfe26bbae151ac15e6.tar.bz2
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
-rw-r--r--src/voicecall.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/voicecall.c b/src/voicecall.c
index 46768dcd..5f5f263e 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);