[svn r596] Fixed memory leak when dealocating GMythChannelInfo. trunk
authormelunko
Tue Apr 24 00:43:20 2007 +0100 (2007-04-24)
branchtrunk
changeset 5901c421f2531d3
parent 589 549c4664701e
child 591 2a503bf691f5
[svn r596] Fixed memory leak when dealocating GMythChannelInfo.
gmyth/src/gmyth_common.c
gmyth/src/gmyth_epg.c
     1.1 --- a/gmyth/src/gmyth_common.c	Mon Apr 23 21:08:07 2007 +0100
     1.2 +++ b/gmyth/src/gmyth_common.c	Tue Apr 24 00:43:20 2007 +0100
     1.3 @@ -95,9 +95,13 @@
     1.4  {
     1.5  #ifdef GMYTH_USE_DEBUG
     1.6      if ( channel_info != NULL ) {
     1.7 +	g_return_if_fail (channel_info->channel_name != NULL);
     1.8 +	g_return_if_fail (channel_info->channel_num != NULL);
     1.9 +
    1.10          gmyth_debug("ChannelInfo (Name, Num, ID) = (%s, %s, %d)\n", 
    1.11               channel_info->channel_name->str, channel_info->channel_num->str, 
    1.12               channel_info->channel_ID);
    1.13 +
    1.14      }
    1.15  #endif
    1.16  }
    1.17 @@ -118,11 +122,11 @@
    1.18  	        "End time = %s\n"
    1.19  	        "Path name = %s\n"
    1.20  	        "File size = %lld\n",
    1.21 -	       	program_info->title ? program_info->title->str : NULL,
    1.22 -	        program_info->description ? program_info->description->str : NULL, 
    1.23 +	       	program_info->title ? program_info->title->str : "NULL",
    1.24 +	        program_info->description ? program_info->description->str : "NULL", 
    1.25  	        gmyth_util_time_to_string_from_time_val(program_info->startts),
    1.26  	        gmyth_util_time_to_string_from_time_val(program_info->endts), 
    1.27 -	        program_info->pathname ? program_info->pathname->str : NULL,
    1.28 +	        program_info->pathname ? program_info->pathname->str : "NULL",
    1.29  	        program_info->filesize );
    1.30  #endif
    1.31  }
    1.32 @@ -131,7 +135,7 @@
    1.33  free_channel_data (gpointer data, gpointer user_data)
    1.34  {
    1.35      /* Frees the GMythChannelInfo structure */
    1.36 -    GMythChannelInfo *channel = (GMythChannelInfo*) user_data;
    1.37 +    GMythChannelInfo *channel = (GMythChannelInfo*) data;
    1.38  
    1.39      gmyth_channel_info_free (channel);
    1.40  }
     2.1 --- a/gmyth/src/gmyth_epg.c	Mon Apr 23 21:08:07 2007 +0100
     2.2 +++ b/gmyth/src/gmyth_epg.c	Tue Apr 24 00:43:20 2007 +0100
     2.3 @@ -168,15 +168,15 @@
     2.4  	
     2.5      if (msql_res == NULL) {
     2.6          gmyth_debug ("[%s] msql query returned NULL MYSQL_RES", __FUNCTION__);
     2.7 -		return -1;
     2.8 +        return -1;
     2.9      } else {
    2.10          MYSQL_ROW row;
    2.11 -		GMythChannelInfo *channel_info;        
    2.12 +        GMythChannelInfo *channel_info;        
    2.13  
    2.14          while ((row = mysql_fetch_row (msql_res)) != NULL) {
    2.15  
    2.16              channel_info = g_new0(GMythChannelInfo, 1);
    2.17 -            channel_info->channel_ID = g_ascii_strtoull (row[0], NULL, 10);
    2.18 +            channel_info->channel_ID = (gint) g_ascii_strtoull (row[0], NULL, 10);
    2.19              channel_info->channel_num = g_string_new (row[1]);
    2.20              channel_info->channel_name = g_string_new (row[2]);
    2.21              channel_info->channel_icon = g_string_new (row[3]);