diff options
author | John Ernberg <john.ernberg@actia.se> | 2016-04-22 13:10:07 +0000 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2016-04-22 15:36:11 -0500 |
commit | 1326026c6da9c2b693d490ab62015aba3f97401c (patch) | |
tree | 709fd2628d8f4d2c3cb00fd5ea0d6ab4660caf66 | |
parent | c9be86ce1afe012abaa68f9b33f3fd588243e9e5 (diff) | |
download | ofono-1326026c6da9c2b693d490ab62015aba3f97401c.tar.gz |
ussd: Use g_slist_free_full
-rw-r--r-- | src/ussd.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -102,8 +102,10 @@ static struct ssc_entry *ssc_entry_create(const char *sc, void *cb, void *data, return r; } -static void ssc_entry_destroy(struct ssc_entry *ca) +static void ssc_entry_destroy(gpointer pointer) { + struct ssc_entry *ca = pointer; + if (ca->destroy) ca->destroy(ca->user); @@ -790,12 +792,10 @@ static void ussd_unregister(struct ofono_atom *atom) struct ofono_modem *modem = __ofono_atom_get_modem(atom); const char *path = __ofono_atom_get_path(atom); - g_slist_foreach(ussd->ss_control_list, (GFunc) ssc_entry_destroy, NULL); - g_slist_free(ussd->ss_control_list); + g_slist_free_full(ussd->ss_control_list, ssc_entry_destroy); ussd->ss_control_list = NULL; - g_slist_foreach(ussd->ss_passwd_list, (GFunc) ssc_entry_destroy, NULL); - g_slist_free(ussd->ss_passwd_list); + g_slist_free_full(ussd->ss_passwd_list, ssc_entry_destroy); ussd->ss_passwd_list = NULL; ofono_modem_remove_interface(modem, |