From 058b9d152fbe6849c87608b880e35b675ffbd4c8 Mon Sep 17 00:00:00 2001 From: Gustavo Sverzut Barbieri Date: Mon, 30 Jul 2012 19:00:37 -0300 Subject: [PATCH] ofono callbacks: do not automatically free callbacks on shutdown. This will help in two fronts: - spot leaks with valgrind, since screens that do not release will show there. - avoid warnings from screens deleting it with their _on_del() --- dialer/ofono.c | 42 ------------------------------------------ 1 file changed, 42 deletions(-) diff --git a/dialer/ofono.c b/dialer/ofono.c index 56610e2..f051013 100644 --- a/dialer/ofono.c +++ b/dialer/ofono.c @@ -2066,39 +2066,6 @@ Eina_Bool ofono_init(void) return EINA_TRUE; } -static void _ofono_callback_modem_list_free(Eina_Inlist **list) -{ - OFono_Callback_List_Modem_Node *node; - - while (*list) { - node = EINA_INLIST_CONTAINER_GET(*list, OFono_Callback_List_Modem_Node); - *list = eina_inlist_remove(*list, *list); - free(node); - } -} - -static void _ofono_callback_call_list_free(Eina_Inlist **list) -{ - OFono_Callback_List_Call_Node *node; - - while (*list) { - node = EINA_INLIST_CONTAINER_GET(*list, OFono_Callback_List_Call_Node); - *list = eina_inlist_remove(*list, *list); - free(node); - } -} - -static void _ofono_callback_call_disconnected_list_free(Eina_Inlist **list) -{ - OFono_Callback_List_Call_Disconnected_Node *node; - - while (*list) { - node = EINA_INLIST_CONTAINER_GET(*list, OFono_Callback_List_Call_Disconnected_Node); - *list = eina_inlist_remove(*list, *list); - free(node); - } -} - void ofono_shutdown(void) { if (pc_get_modems) { @@ -2113,15 +2080,6 @@ void ofono_shutdown(void) modems = NULL; eina_list_free(modem_types); - - _ofono_callback_modem_list_free(&cbs_modem_changed); - _ofono_callback_modem_list_free(&cbs_modem_connected); - _ofono_callback_modem_list_free(&cbs_modem_disconnected); - - _ofono_callback_call_list_free(&cbs_call_changed); - _ofono_callback_call_list_free(&cbs_call_added); - _ofono_callback_call_list_free(&cbs_call_removed); - _ofono_callback_call_disconnected_list_free(&cbs_call_disconnected); } static OFono_Pending *_ofono_call_volume_property_set(char *property, -- 2.7.4