[svn r332] Solve some g_object_unref faults and misusages.
1.1 --- a/gmyth/src/gmyth_backendinfo.c Wed Feb 07 00:03:05 2007 +0000
1.2 +++ b/gmyth/src/gmyth_backendinfo.c Wed Feb 07 18:29:38 2007 +0000
1.3 @@ -78,12 +78,13 @@
1.4 backend_info->db_name = NULL;
1.5 backend_info->port = -1;
1.6
1.7 +/*
1.8 if ( backend_info->uri != NULL )
1.9 {
1.10 g_object_unref(backend_info->uri);
1.11 backend_info->uri = NULL;
1.12 }
1.13 -
1.14 +*/
1.15 G_OBJECT_CLASS (gmyth_backend_info_parent_class)->dispose (object);
1.16 }
1.17
2.1 --- a/gmyth/src/gmyth_livetv.c Wed Feb 07 00:03:05 2007 +0000
2.2 +++ b/gmyth/src/gmyth_livetv.c Wed Feb 07 18:29:38 2007 +0000
2.3 @@ -114,7 +114,7 @@
2.4 livetv->proginfo = NULL;
2.5 }
2.6
2.7 - if ( livetv->file_transfer != NULL ) {
2.8 + if ( livetv->file_transfer != NULL && G_IS_OBJECT(livetv->file_transfer) ) {
2.9 g_object_unref (livetv->file_transfer);
2.10 livetv->file_transfer = NULL;
2.11 }
2.12 @@ -377,7 +377,7 @@
2.13
2.14 } /* if - changes the channel number */
2.15
2.16 - sleep (9); /* FIXME: this is evil (tpm) */
2.17 + sleep (6); /* FIXME: this is evil (tpm) */
2.18 }
2.19
2.20 /* DEBUG message */
3.1 --- a/gmyth/src/gmyth_monitor_handler.c Wed Feb 07 00:03:05 2007 +0000
3.2 +++ b/gmyth/src/gmyth_monitor_handler.c Wed Feb 07 18:29:38 2007 +0000
3.3 @@ -164,16 +164,17 @@
3.4
3.5 if ( monitor->monitor_th != NULL )
3.6 {
3.7 - g_thread_pool_free( monitor->monitor_th, TRUE, FALSE );
3.8 + g_thread_pool_free( monitor->monitor_th, TRUE, TRUE );
3.9 //g_thread_exit( monitor->monitor_th );
3.10 - if ( monitor->monitor_th != NULL )
3.11 - g_object_unref( monitor->monitor_th );
3.12 + /*if ( monitor->monitor_th != NULL )
3.13 + g_object_unref( monitor->monitor_th );*/
3.14 monitor->monitor_th = NULL;
3.15 }
3.16
3.17 if ( monitor->event_sock != NULL )
3.18 {
3.19 - g_object_unref( monitor->event_sock );
3.20 + /* g_object_unref( monitor->event_sock ); */
3.21 + gmyth_socket_close_connection( monitor->event_sock );
3.22 monitor->event_sock = NULL;
3.23 }
3.24
4.1 --- a/gmyth/src/gmyth_recorder.c Wed Feb 07 00:03:05 2007 +0000
4.2 +++ b/gmyth/src/gmyth_recorder.c Wed Feb 07 18:29:38 2007 +0000
4.3 @@ -428,12 +428,12 @@
4.4
4.5 tmp_str = gmyth_string_list_get_string (str_list, 0);
4.6 if (tmp_str == NULL) {
4.7 - g_warning ("[%s] SET_CHANNEL name request returned %s", __FUNCTION__, tmp_str->str );
4.8 + g_warning ("[%s] SET_CHANNEL name request returned NULL!", __FUNCTION__);
4.9 return FALSE;
4.10 }
4.11
4.12 - if (g_ascii_strncasecmp (tmp_str->str, "ok", 2) || g_ascii_strtoull( tmp_str->str, NULL, 10 ) == 0 ) {
4.13 - g_warning ("[%s] SET_CHANNEL name request returned %s", __FUNCTION__, tmp_str->str);
4.14 + if (tmp_str!= NULL && g_ascii_strncasecmp (tmp_str->str, "ok", 2) /*|| g_ascii_strtoull( tmp_str->str, NULL, 10 ) == 0 */ ) {
4.15 + g_warning ("XXXXXX[%s] SET_CHANNEL name request returned not ok", __FUNCTION__);
4.16 g_object_unref (str_list);
4.17 return FALSE;
4.18 }
5.1 --- a/gmyth/src/gmyth_socket.c Wed Feb 07 00:03:05 2007 +0000
5.2 +++ b/gmyth/src/gmyth_socket.c Wed Feb 07 18:29:38 2007 +0000
5.3 @@ -794,13 +794,15 @@
5.4 void
5.5 gmyth_socket_close_connection (GMythSocket *gmyth_socket)
5.6 {
5.7 + if ( gmyth_socket->sd != -1 ) {
5.8 close (gmyth_socket->sd);
5.9 gmyth_socket->sd = -1;
5.10 + }
5.11
5.12 - if (gmyth_socket->sd_io_ch != NULL) {
5.13 - g_io_channel_unref (gmyth_socket->sd_io_ch);
5.14 - gmyth_socket->sd_io_ch = NULL;
5.15 - }
5.16 + if (gmyth_socket->sd_io_ch != NULL) {
5.17 + g_io_channel_unref (gmyth_socket->sd_io_ch);
5.18 + gmyth_socket->sd_io_ch = NULL;
5.19 + }
5.20 }
5.21
5.22