# HG changeset patch # User melunko # Date 1177438535 -3600 # Node ID 2a503bf691f5de6c11fc578b5cbcaf4f7a6146e8 # Parent 1c421f2531d3f5a266159557e106431b45a535a3 [svn r597] Added functions to free schedule_info and recorded_info data and lists diff -r 1c421f2531d3 -r 2a503bf691f5 gmyth/src/gmyth_scheduler.c --- a/gmyth/src/gmyth_scheduler.c Tue Apr 24 00:43:20 2007 +0100 +++ b/gmyth/src/gmyth_scheduler.c Tue Apr 24 19:15:35 2007 +0100 @@ -659,7 +659,7 @@ } void -gmyth_scheduler_recorded_info_free (RecordedInfo *info) +gmyth_recorded_info_free (RecordedInfo *info) { if (info->title != NULL) g_string_free (info->title, TRUE); @@ -685,9 +685,29 @@ g_free (info); } +static void +free_recorded_info_item (gpointer data, gpointer user_data) +{ + RecordedInfo *info = (RecordedInfo*) data; + + gmyth_recorded_info_free (info); +} + void -gmyth_scheduler_schedule_info_free (ScheduleInfo *info) +gmyth_recorded_info_list_free (GList *list) { + g_return_if_fail (list != NULL); + + g_list_foreach (list, free_recorded_info_item, NULL); + g_list_free (list); +} + +void +gmyth_schedule_info_free (ScheduleInfo *info) +{ + + g_return_if_fail (info != NULL); + if (info->title != NULL) g_string_free (info->title, TRUE); @@ -709,3 +729,19 @@ g_free (info); } +static void +free_schedule_info_item (gpointer data, gpointer user_data) +{ + ScheduleInfo *info = (ScheduleInfo*) data; + + gmyth_schedule_info_free (info); +} + +void +gmyth_schedule_info_list_free (GList *list) +{ + g_return_if_fail (list != NULL); + + g_list_foreach (list, free_schedule_info_item, NULL); + g_list_free (list); +} diff -r 1c421f2531d3 -r 2a503bf691f5 gmyth/src/gmyth_scheduler.h --- a/gmyth/src/gmyth_scheduler.h Tue Apr 24 00:43:20 2007 +0100 +++ b/gmyth/src/gmyth_scheduler.h Tue Apr 24 19:15:35 2007 +0100 @@ -160,8 +160,11 @@ void gmyth_scheduler_recorded_info_get_preview (RecordedInfo *info, GByteArray* data); -void gmyth_scheduler_schedule_info_free (ScheduleInfo *info); -void gmyth_scheduler_recorded_info_free (RecordedInfo *info); +void gmyth_recorded_info_free (RecordedInfo *info); +void gmyth_schedule_info_free (ScheduleInfo *info); + +void gmyth_recorded_info_list_free (GList *list); +void gmyth_schedule_info_list_free (GList *list); G_END_DECLS