# HG changeset patch
# User leo_sobral
# Date 1174943085 -3600
# Node ID 8efecea98bd77b038cb3eb2a8fed649d68555167
# Parent  12308ae2d90704b73d6305dcc7c4f5be2cf1d0bb
[svn r457] added check != NULL before g_string_free to avoid GLib Critical warnings

diff -r 12308ae2d907 -r 8efecea98bd7 gmyth/src/gmyth_livetv.c
--- a/gmyth/src/gmyth_livetv.c	Mon Mar 26 20:19:42 2007 +0100
+++ b/gmyth/src/gmyth_livetv.c	Mon Mar 26 22:04:45 2007 +0100
@@ -141,8 +141,11 @@
 		g_mutex_free (livetv->mutex);
 		livetv->mutex = NULL;
 	}
-
-    g_string_free (livetv->local_hostname, TRUE);
+    
+    if ( livetv->local_hostname != NULL ) {
+        g_string_free (livetv->local_hostname, TRUE);
+        livetv->local_hostname = NULL;
+    }
 
 	G_OBJECT_CLASS (gmyth_livetv_parent_class)->dispose (object);
 }
diff -r 12308ae2d907 -r 8efecea98bd7 gmyth/src/gmyth_stringlist.c
--- a/gmyth/src/gmyth_stringlist.c	Mon Mar 26 20:19:42 2007 +0100
+++ b/gmyth/src/gmyth_stringlist.c	Mon Mar 26 22:04:45 2007 +0100
@@ -358,7 +358,8 @@
 static void
 gmyth_string_list_clear_element( GString *str_elem, void *data_aux )
 {
-    g_string_free( str_elem, TRUE );
+    if (str_elem != NULL)
+        g_string_free( str_elem, TRUE );
 }
 
 /** Removes all strings from the string list.
diff -r 12308ae2d907 -r 8efecea98bd7 gmyth/src/gmyth_tvchain.c
--- a/gmyth/src/gmyth_tvchain.c	Mon Mar 26 20:19:42 2007 +0100
+++ b/gmyth/src/gmyth_tvchain.c	Mon Mar 26 22:04:45 2007 +0100
@@ -89,7 +89,10 @@
 {
     GMythTVChain *tvchain = GMYTH_TVCHAIN(object);
 
-    g_string_free( tvchain->tvchain_id, TRUE );
+    if (tvchain->tvchain_id != NULL) {
+        g_string_free( tvchain->tvchain_id, TRUE );
+        tvchain->tvchain_id = NULL;
+    }
     
     if ( tvchain->mutex != NULL ) {
     	g_mutex_free( tvchain->mutex );
@@ -101,7 +104,10 @@
         g_list_free( tvchain->tvchain_list );
     }
 
-	g_string_free( tvchain->cur_chanid, TRUE );
+    if (tvchain->cur_chanid != NULL) {
+        g_string_free( tvchain->cur_chanid, TRUE );
+        tvchain->cur_chanid = NULL;
+    }
 
     if ( tvchain->backend_info) {
         g_object_unref (tvchain->backend_info);
@@ -405,13 +411,33 @@
 
     entry = (struct LiveTVChainEntry *) data;
 
-    g_string_free (entry->chanid, TRUE);
-    g_free (entry->starttime);
-    g_free (entry->endtime);
-    g_string_free (entry->hostprefix, TRUE);
-    g_string_free (entry->cardtype, TRUE);
-    g_string_free (entry->channum, TRUE);
-    g_string_free (entry->inputname, TRUE);
+    if (entry->chanid != NULL) {
+        g_string_free (entry->chanid, TRUE);
+    }
+
+    if (entry->starttime != NULL) {
+        g_free (entry->starttime);
+    }
+
+    if (entry->endtime != NULL) {
+       g_free (entry->endtime);
+    }
+
+    if (entry->hostprefix) {
+        g_string_free (entry->hostprefix, TRUE);
+    }
+
+    if (entry->cardtype) {
+        g_string_free (entry->cardtype, TRUE);
+    }
+
+    if (entry->channum) {
+        g_string_free (entry->channum, TRUE);
+    }
+
+    if (entry->inputname) {
+        g_string_free (entry->inputname, TRUE);
+    }
 
     g_free(entry);
 }