[grilo] core: configurations are stored in a list



commit 0c3913e2a01f8949c380dc3c5eb86c73020410d8
Author: Juan A. Suarez Romero <jasuarez igalia com>
Date:   Sun Mar 9 00:03:32 2014 +0000

    core: configurations are stored in a list
    
    When freeing the list of configurations, do not unref directly because they are
    inside a list. Use g_list_free_full() to do the job.

 src/grl-registry.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/grl-registry.c b/src/grl-registry.c
index 46b366b..0572597 100644
--- a/src/grl-registry.c
+++ b/src/grl-registry.c
@@ -107,6 +107,8 @@ static GrlKeyID key_id_handler_add (struct KeyIDHandler *handler,
 
 static void shutdown_plugin (GrlPlugin *plugin);
 
+static void configs_free (GList *configs);
+
 /* ================ GrlRegistry GObject ================ */
 
 enum {
@@ -168,7 +170,7 @@ grl_registry_init (GrlRegistry *registry)
   registry->priv = GRL_REGISTRY_GET_PRIVATE (registry);
 
   registry->priv->configs =
-    g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
+    g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify) configs_free);
   registry->priv->plugins =
     g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
   registry->priv->sources =
@@ -186,6 +188,12 @@ grl_registry_init (GrlRegistry *registry)
 /* ================ Utitilies ================ */
 
 static void
+configs_free (GList *configs)
+{
+  g_list_free_full (configs, g_object_unref);
+}
+
+static void
 config_source_rank (GrlRegistry *registry,
                     const gchar *source_id,
                     gint rank)


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