[grilo-plugins] [filesystem] Add the finalize to clean the chosen paths list



commit 04aa3f17c7379be20587ca0269068d24c62011b9
Author: Joaquim Rocha <jrocha igalia com>
Date:   Thu Jun 10 18:25:17 2010 +0200

    [filesystem] Add the finalize to clean the chosen paths list

 src/filesystem/grl-filesystem.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/filesystem/grl-filesystem.c b/src/filesystem/grl-filesystem.c
index d4cb0f5..4aa0527 100644
--- a/src/filesystem/grl-filesystem.c
+++ b/src/filesystem/grl-filesystem.c
@@ -103,6 +103,7 @@ static void grl_filesystem_source_metadata (GrlMediaSource *source,
 static void grl_filesystem_source_browse (GrlMediaSource *source,
                                           GrlMediaSourceBrowseSpec *bs);
 
+static void grl_filesystem_source_finalize (GObject *object);
 
 /* =================== Filesystem Plugin  =============== */
 
@@ -165,6 +166,7 @@ grl_filesystem_source_class_init (GrlFilesystemSourceClass * klass)
   GrlMetadataSourceClass *metadata_class = GRL_METADATA_SOURCE_CLASS (klass);
   source_class->browse = grl_filesystem_source_browse;
   source_class->metadata = grl_filesystem_source_metadata;
+  G_OBJECT_CLASS (source_class)->finalize = grl_filesystem_source_finalize;
   metadata_class->supported_keys = grl_filesystem_source_supported_keys;
   g_type_class_add_private (klass, sizeof (GrlFilesystemSourcePrivate));
 }
@@ -615,3 +617,12 @@ grl_filesystem_source_metadata (GrlMediaSource *source,
     g_error_free (error);
   }
 }
+
+static void
+grl_filesystem_source_finalize (GObject *object)
+{
+  GrlFilesystemSource *filesystem_source = GRL_FILESYSTEM_SOURCE (object);
+  g_list_foreach (filesystem_source->priv->chosen_paths, (GFunc) g_free, NULL);
+  g_list_free (filesystem_source->priv->chosen_paths);
+  G_OBJECT_CLASS (grl_filesystem_source_parent_class)->finalize (object);
+}



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