diff --git a/gnome/src/actions.c b/gnome/src/actions.c index 6f7885e56ea07f1dfa52468191f78edc48763458..55a17aff3a348edccee4cbe64af0f85baf3dbfc7 100644 --- a/gnome/src/actions.c +++ b/gnome/src/actions.c @@ -199,7 +199,9 @@ sflphone_quit () dbus_unregister (getpid()); dbus_clean (); - //call_list_clean(); TODO + calllist_clean (current_calls); + calllist_clean (contacts); + calllist_clean (history); //account_list_clean() gtk_main_quit (); } diff --git a/gnome/src/contacts/calllist.c b/gnome/src/contacts/calllist.c index 56e06a8d277b694ffa8d943fd84105f124f657f9..93e779a6486b55744a16c72ff09218ebdf34841b 100644 --- a/gnome/src/contacts/calllist.c +++ b/gnome/src/contacts/calllist.c @@ -102,16 +102,31 @@ calllist_init (calltab_t* tab) tab->selectedCall = NULL; } +/* + * Function passed to calllist_clean to free every QueueElement. + */ +static void +calllist_free_element(gpointer data, gpointer user_data) +{ + QueueElement *element = data; + if (element->type == HIST_CONFERENCE) + free_conference_obj_t (element->elem.conf); + else /* HIST_CALL */ + free_callable_obj_t (element->elem.call); + free (element); +} + void calllist_clean (calltab_t* tab) { + g_queue_foreach (tab->callQueue, calllist_free_element, NULL); g_queue_free (tab->callQueue); } void calllist_reset (calltab_t* tab) { - g_queue_free (tab->callQueue); + calllist_clean (tab); tab->callQueue = g_queue_new(); }