[svn r336] More fixes on disposing GObjects. trunk
authorrosfran
Wed Feb 07 20:39:10 2007 +0000 (2007-02-07)
branchtrunk
changeset 334e326033fb048
parent 333 f9d778bb88a2
child 335 aedcbbf818b7
[svn r336] More fixes on disposing GObjects.
gmyth/src/gmyth_livetv.c
gmyth/src/gmyth_recorder.c
gmyth/src/gmyth_tvchain.c
gmyth/src/gmyth_tvchain.h
     1.1 --- a/gmyth/src/gmyth_livetv.c	Wed Feb 07 20:38:39 2007 +0000
     1.2 +++ b/gmyth/src/gmyth_livetv.c	Wed Feb 07 20:39:10 2007 +0000
     1.3 @@ -329,7 +329,7 @@
     1.4  	}
     1.5  	
     1.6  	/* Creates livetv chain handler */
     1.7 -	livetv->tvchain = GMYTH_TVCHAIN ( g_object_new(GMYTH_TVCHAIN_TYPE, NULL) );
     1.8 +	livetv->tvchain = gmyth_tvchain_new();
     1.9  	gmyth_tvchain_initialize ( livetv->tvchain, livetv->backend_info );
    1.10  
    1.11  	if ( livetv->tvchain == NULL || livetv->tvchain->tvchain_id == NULL ) {
     2.1 --- a/gmyth/src/gmyth_recorder.c	Wed Feb 07 20:38:39 2007 +0000
     2.2 +++ b/gmyth/src/gmyth_recorder.c	Wed Feb 07 20:39:10 2007 +0000
     2.3 @@ -82,8 +82,10 @@
     2.4    GMythRecorder *recorder = GMYTH_RECORDER(object);
     2.5  
     2.6  	gmyth_debug ("[%s] Closing control socket", __FUNCTION__);
     2.7 -	gmyth_socket_close_connection(recorder->myth_socket);
     2.8 -	g_object_unref (recorder->myth_socket);
     2.9 +	/*gmyth_socket_close_connection(recorder->myth_socket);*/
    2.10 +	
    2.11 +	if ( recorder->myth_socket != NULL )
    2.12 +		g_object_unref (recorder->myth_socket);	
    2.13      
    2.14    G_OBJECT_CLASS (gmyth_recorder_parent_class)->finalize (object);
    2.15  }
     3.1 --- a/gmyth/src/gmyth_tvchain.c	Wed Feb 07 20:38:39 2007 +0000
     3.2 +++ b/gmyth/src/gmyth_tvchain.c	Wed Feb 07 20:39:10 2007 +0000
     3.3 @@ -74,6 +74,14 @@
     3.4  	tvchain->cur_startts = NULL;
     3.5  }
     3.6  
     3.7 +GMythTVChain*
     3.8 +gmyth_tvchain_new ()
     3.9 +{
    3.10 +	GMythTVChain *tvchain = GMYTH_TVCHAIN ( g_object_new( GMYTH_TVCHAIN_TYPE, NULL ) );
    3.11 +
    3.12 +	return tvchain;
    3.13 +}
    3.14 +
    3.15  static void
    3.16  gmyth_tvchain_dispose  (GObject *object)
    3.17  {
     4.1 --- a/gmyth/src/gmyth_tvchain.h	Wed Feb 07 20:38:39 2007 +0000
     4.2 +++ b/gmyth/src/gmyth_tvchain.h	Wed Feb 07 20:39:10 2007 +0000
     4.3 @@ -86,14 +86,15 @@
     4.4    GMythBackendInfo *backend_info;
     4.5  };
     4.6  
     4.7 +GType       	gmyth_tvchain_get_type (void);
     4.8  
     4.9 -GType       gmyth_tvchain_get_type (void);
    4.10 +GMythTVChain* gmyth_tvchain_new ();
    4.11  
    4.12 -gboolean        gmyth_tvchain_initialize    (GMythTVChain *tvchain, 
    4.13 +gboolean      gmyth_tvchain_initialize    (GMythTVChain *tvchain, 
    4.14                                           GMythBackendInfo *backend_info);
    4.15 -gboolean    gmyth_tvchain_reload_all    (GMythTVChain *tvchain);
    4.16 -GString*    gmyth_tvchain_get_id        (GMythTVChain *tvchain);
    4.17 -gint         gmyth_tvchain_program_is_at (GMythTVChain *tvchain, 
    4.18 +gboolean    	gmyth_tvchain_reload_all    (GMythTVChain *tvchain);
    4.19 +GString*    	gmyth_tvchain_get_id        (GMythTVChain *tvchain);
    4.20 +gint         	gmyth_tvchain_program_is_at (GMythTVChain *tvchain, 
    4.21                                           GString *chanid, GTimeVal* startts);
    4.22  
    4.23  struct LiveTVChainEntry* gmyth_tvchain_get_entry_at (GMythTVChain *tvchain,