summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2008-08-18 14:06:04 +0000
committerBastien Nocera <hadess@src.gnome.org>2008-08-18 14:06:04 +0000
commitb7e3b185787ee99d12d4e0a03d65386da74f8741 (patch)
tree912225ca74995afdc8556f198f9b3388ae80e94e
parent703a5f1f31a5f733896300f7fc45c73ad01056e3 (diff)
Unset GValues after having used them, to make sure they get cleaned up,
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 svn path=/trunk/; revision=5565
-rw-r--r--ChangeLog16
-rw-r--r--src/plugins/ontop/totem-ontop.c1
-rw-r--r--src/plugins/tracker/totem-tracker-widget.c2
-rw-r--r--src/totem-cell-renderer-video.c2
-rw-r--r--src/totem-sidebar.c1
-rw-r--r--src/totem-video-indexer.c2
-rw-r--r--src/totem-video-thumbnailer.c8
-rw-r--r--src/totem.c2
8 files changed, 30 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 9f37a51f..001c251c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,21 @@
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
+
+2008-08-18 Bastien Nocera <hadess@hadess.net>
+
* src/totem-session.c (totem_session_restore):
* src/totem.c (update_mrl_label), (on_error_event),
(update_seekable): Only seek for session restore once
diff --git a/src/plugins/ontop/totem-ontop.c b/src/plugins/ontop/totem-ontop.c
index ab13504d..e9539e0b 100644
--- a/src/plugins/ontop/totem-ontop.c
+++ b/src/plugins/ontop/totem-ontop.c
@@ -99,6 +99,7 @@ update_from_state (TotemOntopPluginPrivate *priv)
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
diff --git a/src/plugins/tracker/totem-tracker-widget.c b/src/plugins/tracker/totem-tracker-widget.c
index 8d45a3d0..fc598042 100644
--- a/src/plugins/tracker/totem-tracker-widget.c
+++ b/src/plugins/tracker/totem-tracker-widget.c
@@ -125,7 +125,7 @@ totem_tracker_widget_set_property (GObject *object,
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:
diff --git a/src/totem-cell-renderer-video.c b/src/totem-cell-renderer-video.c
index f4a0d7e2..8d38df69 100644
--- a/src/totem-cell-renderer-video.c
+++ b/src/totem-cell-renderer-video.c
@@ -156,7 +156,7 @@ totem_cell_renderer_video_set_property (GObject *object, guint property_id, cons
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);
diff --git a/src/totem-sidebar.c b/src/totem-sidebar.c
index 41ba5789..c1a0308c 100644
--- a/src/totem-sidebar.c
+++ b/src/totem-sidebar.c
@@ -44,6 +44,7 @@ cb_resize (Totem * totem)
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;
diff --git a/src/totem-video-indexer.c b/src/totem-video-indexer.c
index cc0ebdcc..5bc14978 100644
--- a/src/totem-video-indexer.c
+++ b/src/totem-video-indexer.c
@@ -73,6 +73,7 @@ totem_print_string (BaconVideoWidget *bvw, const char *key, BaconVideoWidgetMeta
if (str != NULL) {
g_print ("%s=%s\n", key, str);
}
+ g_value_unset (&value);
}
static void
@@ -87,6 +88,7 @@ totem_print_int (BaconVideoWidget *bvw, const char *key, BaconVideoWidgetMetadat
if (num != 0) {
g_print ("%s=%d\n", key, num);
}
+ g_value_unset (&value);
}
static void
diff --git a/src/totem-video-thumbnailer.c b/src/totem-video-thumbnailer.c
index 6b073f0b..513d698b 100644
--- a/src/totem-video-thumbnailer.c
+++ b/src/totem-video-thumbnailer.c
@@ -426,9 +426,12 @@ static gboolean
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 @@ on_got_metadata_event (BaconVideoWidget *bvw, callback_data *data)
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");
diff --git a/src/totem.c b/src/totem.c
index efdee4fb..532456cf 100644
--- a/src/totem.c
+++ b/src/totem.c
@@ -976,6 +976,7 @@ totem_get_nice_name_for_stream (Totem *totem)
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 @@ show_controls (Totem *totem, gboolean was_fullscreen)
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