[totem] Fix memory leaks when mounting GIO mounts
- From: Bastien Nocera <hadess src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [totem] Fix memory leaks when mounting GIO mounts
- Date: Thu, 12 Nov 2009 18:40:36 +0000 (UTC)
commit 290dfcebaedaba8f878323b4859f0856a30cfa30
Author: Bastien Nocera <hadess hadess net>
Date: Thu Nov 12 15:35:52 2009 +0000
Fix memory leaks when mounting GIO mounts
Getting the URI from the playbin object doesn't give you a
const char, but a copy of the URI.
src/backend/bacon-video-widget-gst-0.10.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/backend/bacon-video-widget-gst-0.10.c b/src/backend/bacon-video-widget-gst-0.10.c
index 6e8d645..94adf0d 100644
--- a/src/backend/bacon-video-widget-gst-0.10.c
+++ b/src/backend/bacon-video-widget-gst-0.10.c
@@ -1363,7 +1363,7 @@ mount_cb (GObject *obj, GAsyncResult *res, gpointer user_data)
{
BaconVideoWidget * bvw = user_data;
gboolean ret;
- const gchar *uri;
+ gchar *uri;
GError *error = NULL;
ret = g_file_mount_enclosing_volume_finish (G_FILE (obj), res, &error);
@@ -1395,6 +1395,8 @@ mount_cb (GObject *obj, GAsyncResult *res, gpointer user_data)
g_signal_emit (bvw, bvw_signals[SIGNAL_ERROR], 0, err->message, FALSE, FALSE);
g_error_free (err);
}
+
+ g_free (uri);
}
static void
@@ -1446,7 +1448,7 @@ bvw_handle_element_message (BaconVideoWidget *bvw, GstMessage *msg)
GFile *file;
GMountOperation *mount_op;
GtkWidget *toplevel;
- const gchar *uri;
+ gchar *uri;
g_object_get (G_OBJECT (bvw->priv->play), "uri", &uri, NULL);
@@ -1458,6 +1460,7 @@ bvw_handle_element_message (BaconVideoWidget *bvw, GstMessage *msg)
}
GST_DEBUG ("Trying to mount location '%s'", GST_STR_NULL (uri));
+ g_free (uri);
toplevel = gtk_widget_get_toplevel (GTK_WIDGET (bvw));
if (toplevel == GTK_WIDGET (bvw) || !GTK_IS_WINDOW (toplevel))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]