totem r5565 - in trunk: . src src/plugins/ontop src/plugins/tracker



Author: hadess
Date: Mon Aug 18 14:06:04 2008
New Revision: 5565
URL: http://svn.gnome.org/viewvc/totem?rev=5565&view=rev

Log:
2008-08-18  Bastien Nocera  <hadess hadess net>

	* src/plugins/ontop/totem-ontop.c (update_from_state):
	* src/plugins/tracker/totem-tracker-widget.c
	(totem_tracker_widget_set_property):
	* src/totem-cell-renderer-video.c
	(totem_cell_renderer_video_set_property):
	* src/totem-sidebar.c (cb_resize):
	* src/totem-video-indexer.c (totem_print_string),
	(totem_print_int):
	* src/totem-video-thumbnailer.c (has_audio),
	(on_got_metadata_event):
	* src/totem.c (totem_get_nice_name_for_stream), (show_controls):
	Unset GValues after having used them, to make sure they get cleaned
	up, fixes a few memleaks, Use g_value_dup_* functions when necessary



Modified:
   trunk/ChangeLog
   trunk/src/plugins/ontop/totem-ontop.c
   trunk/src/plugins/tracker/totem-tracker-widget.c
   trunk/src/totem-cell-renderer-video.c
   trunk/src/totem-sidebar.c
   trunk/src/totem-video-indexer.c
   trunk/src/totem-video-thumbnailer.c
   trunk/src/totem.c

Modified: trunk/src/plugins/ontop/totem-ontop.c
==============================================================================
--- trunk/src/plugins/ontop/totem-ontop.c	(original)
+++ trunk/src/plugins/ontop/totem-ontop.c	Mon Aug 18 14:06:04 2008
@@ -99,6 +99,7 @@
 	gtk_window_set_keep_above (priv->window,
 				   (totem_is_playing (priv->totem) != FALSE &&
 				    g_value_get_boolean (&has_video) != FALSE));
+	g_value_unset (&has_video);
 }
 
 static void

Modified: trunk/src/plugins/tracker/totem-tracker-widget.c
==============================================================================
--- trunk/src/plugins/tracker/totem-tracker-widget.c	(original)
+++ trunk/src/plugins/tracker/totem-tracker-widget.c	Mon Aug 18 14:06:04 2008
@@ -125,7 +125,7 @@
 	switch (property_id)
 	{
 	case PROP_TOTEM:
-		widget->totem = g_object_ref (g_value_get_object (value));
+		widget->totem = g_value_dup_object (value);
 		g_object_set (G_OBJECT (widget->priv->result_list), "totem", widget->totem, NULL);
 		break;
 	default:

Modified: trunk/src/totem-cell-renderer-video.c
==============================================================================
--- trunk/src/totem-cell-renderer-video.c	(original)
+++ trunk/src/totem-cell-renderer-video.c	Mon Aug 18 14:06:04 2008
@@ -156,7 +156,7 @@
 			break;
 		case PROP_TITLE:
 			g_free (priv->title);
-			priv->title = g_strdup (g_value_get_string (value));
+			priv->title = g_value_dup_string (value);
 			break;
 		case PROP_ALIGNMENT:
 			priv->alignment = g_value_get_enum (value);

Modified: trunk/src/totem-sidebar.c
==============================================================================
--- trunk/src/totem-sidebar.c	(original)
+++ trunk/src/totem-sidebar.c	Mon Aug 18 14:06:04 2008
@@ -44,6 +44,7 @@
 	pane = GTK_WIDGET (gtk_builder_get_object (totem->xml, "tmw_main_pane"));
 	gtk_widget_style_get_property (pane, "handle-size", &gvalue_size);
 	handle_size = g_value_get_int (&gvalue_size);
+	g_value_unset (&gvalue_size);
 	
 	if (totem->sidebar_shown) {
 		w += totem->sidebar->allocation.width + handle_size;

Modified: trunk/src/totem-video-indexer.c
==============================================================================
--- trunk/src/totem-video-indexer.c	(original)
+++ trunk/src/totem-video-indexer.c	Mon Aug 18 14:06:04 2008
@@ -73,6 +73,7 @@
 	if (str != NULL) {
 		g_print ("%s=%s\n", key, str);
 	}
+	g_value_unset (&value);
 }
 
 static void
@@ -87,6 +88,7 @@
 	if (num != 0) {
 		g_print ("%s=%d\n", key, num);
 	}
+	g_value_unset (&value);
 }
 
 static void

Modified: trunk/src/totem-video-thumbnailer.c
==============================================================================
--- trunk/src/totem-video-thumbnailer.c	(original)
+++ trunk/src/totem-video-thumbnailer.c	Mon Aug 18 14:06:04 2008
@@ -426,9 +426,12 @@
 has_audio (BaconVideoWidget *bvw)
 {
 	GValue value = { 0, };
+	gboolean retval;
 
 	bacon_video_widget_get_metadata (bvw, BVW_INFO_HAS_VIDEO, &value);
-	return g_value_get_boolean (&value);
+	retval = g_value_get_boolean (&value);
+	g_value_unset (&value);
+	return retval;
 }
 
 static void
@@ -439,7 +442,8 @@
 
 	PROGRESS_DEBUG("Got metadata, checking if we have a cover");
 	bacon_video_widget_get_metadata (bvw, BVW_INFO_COVER, &value);
-	pixbuf = g_value_get_object (&value);
+	pixbuf = g_value_dup_object (&value);
+	g_value_unset (&value);
 
 	if (pixbuf) {
 		PROGRESS_DEBUG("Saving cover image");

Modified: trunk/src/totem.c
==============================================================================
--- trunk/src/totem.c	(original)
+++ trunk/src/totem.c	Mon Aug 18 14:06:04 2008
@@ -976,6 +976,7 @@
 					 BVW_INFO_TRACK_NUMBER,
 					 &value);
 	tracknum = g_value_get_int (&value);
+	g_value_unset (&value);
 
 	if (tracknum != 0) {
 		retval = g_strdup_printf ("%02d. %s - %s",
@@ -2049,6 +2050,7 @@
 			gtk_widget_style_get_property (pane, "handle-size",
 					&value);
 			handle_size = g_value_get_int (&value);
+			g_value_unset (&value);
 			
 			gtk_widget_show (totem->sidebar);
 			width += totem->sidebar->allocation.width



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]