[svn r597] Added functions to free schedule_info and recorded_info data and lists trunk
authormelunko
Tue Apr 24 19:15:35 2007 +0100 (2007-04-24)
branchtrunk
changeset 5912a503bf691f5
parent 590 1c421f2531d3
child 592 0f77fcb97269
[svn r597] Added functions to free schedule_info and recorded_info data and lists
gmyth/src/gmyth_scheduler.c
gmyth/src/gmyth_scheduler.h
     1.1 --- a/gmyth/src/gmyth_scheduler.c	Tue Apr 24 00:43:20 2007 +0100
     1.2 +++ b/gmyth/src/gmyth_scheduler.c	Tue Apr 24 19:15:35 2007 +0100
     1.3 @@ -659,7 +659,7 @@
     1.4  }
     1.5  
     1.6  void
     1.7 -gmyth_scheduler_recorded_info_free (RecordedInfo *info)
     1.8 +gmyth_recorded_info_free (RecordedInfo *info)
     1.9  {
    1.10      if (info->title != NULL)
    1.11          g_string_free (info->title, TRUE);
    1.12 @@ -685,9 +685,29 @@
    1.13      g_free (info);
    1.14  }
    1.15  
    1.16 +static void
    1.17 +free_recorded_info_item (gpointer data, gpointer user_data)
    1.18 +{
    1.19 +    RecordedInfo *info = (RecordedInfo*) data;
    1.20 +
    1.21 +    gmyth_recorded_info_free (info);
    1.22 +}
    1.23 +
    1.24  void
    1.25 -gmyth_scheduler_schedule_info_free (ScheduleInfo *info)
    1.26 +gmyth_recorded_info_list_free (GList *list)
    1.27  {
    1.28 +    g_return_if_fail (list != NULL);
    1.29 +
    1.30 +    g_list_foreach (list, free_recorded_info_item, NULL);
    1.31 +    g_list_free (list);
    1.32 +}
    1.33 +
    1.34 +void
    1.35 +gmyth_schedule_info_free (ScheduleInfo *info)
    1.36 +{
    1.37 +
    1.38 +    g_return_if_fail (info != NULL);
    1.39 +
    1.40      if (info->title != NULL)
    1.41          g_string_free (info->title, TRUE);
    1.42  
    1.43 @@ -709,3 +729,19 @@
    1.44      g_free (info);
    1.45  }
    1.46  
    1.47 +static void
    1.48 +free_schedule_info_item (gpointer data, gpointer user_data)
    1.49 +{
    1.50 +    ScheduleInfo *info = (ScheduleInfo*) data;
    1.51 +
    1.52 +    gmyth_schedule_info_free (info);
    1.53 +}
    1.54 +
    1.55 +void
    1.56 +gmyth_schedule_info_list_free (GList *list)
    1.57 +{
    1.58 +    g_return_if_fail (list != NULL);
    1.59 +
    1.60 +    g_list_foreach (list, free_schedule_info_item, NULL);
    1.61 +    g_list_free (list);
    1.62 +}
     2.1 --- a/gmyth/src/gmyth_scheduler.h	Tue Apr 24 00:43:20 2007 +0100
     2.2 +++ b/gmyth/src/gmyth_scheduler.h	Tue Apr 24 19:15:35 2007 +0100
     2.3 @@ -160,8 +160,11 @@
     2.4  void            gmyth_scheduler_recorded_info_get_preview (RecordedInfo *info, 
     2.5                                                             GByteArray* data);
     2.6  
     2.7 -void            gmyth_scheduler_schedule_info_free (ScheduleInfo *info);
     2.8 -void            gmyth_scheduler_recorded_info_free (RecordedInfo *info);
     2.9 +void            gmyth_recorded_info_free (RecordedInfo *info);
    2.10 +void            gmyth_schedule_info_free (ScheduleInfo *info);
    2.11 +
    2.12 +void		gmyth_recorded_info_list_free (GList *list);
    2.13 +void		gmyth_schedule_info_list_free (GList *list);
    2.14  
    2.15  G_END_DECLS
    2.16