[Xfce4-commits] [panel-plugins/xfce4-indicator-plugin] 01/01: Fixed bugs exposed by xfconf-4.13

noreply at xfce.org noreply at xfce.org
Thu Jul 13 22:22:11 CEST 2017


This is an automated email from the git hooks/post-receive script.

a   n   d   r   z   e   j   r       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository panel-plugins/xfce4-indicator-plugin.

commit 8d14a3ad5ed9c25563aaa8f9c6681c61bae30ba5
Author: Andrzej <andrzejr at xfce.org>
Date:   Thu Jul 13 21:22:03 2017 +0100

    Fixed bugs exposed by xfconf-4.13
---
 panel-plugin/indicator-config.c | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/panel-plugin/indicator-config.c b/panel-plugin/indicator-config.c
index 3193514..8ce56a7 100644
--- a/panel-plugin/indicator-config.c
+++ b/panel-plugin/indicator-config.c
@@ -253,6 +253,17 @@ indicator_config_finalize (GObject *object)
 
 
 static void
+indicator_config_free_array_element (gpointer data)
+{
+  GValue *value = (GValue *) data;
+
+  g_value_unset (value);
+  g_free (value);
+}
+
+
+
+static void
 indicator_config_collect_keys (gpointer key,
                                gpointer value,
                                gpointer array)
@@ -293,21 +304,21 @@ indicator_config_get_property (GObject    *object,
       break;
 
     case PROP_BLACKLIST:
-      array = g_ptr_array_new ();
+      array = g_ptr_array_new_full (1, indicator_config_free_array_element);
       g_hash_table_foreach (config->blacklist, indicator_config_collect_keys, array);
       g_value_set_boxed (value, array);
-      xfconf_array_free (array);
+      g_ptr_array_unref (array);
       break;
 
     case PROP_WHITELIST:
-      array = g_ptr_array_new ();
+      array = g_ptr_array_new_full (1, indicator_config_free_array_element);
       g_hash_table_foreach (config->whitelist, indicator_config_collect_keys, array);
       g_value_set_boxed (value, array);
-      xfconf_array_free (array);
+      g_ptr_array_unref (array);
       break;
 
     case PROP_KNOWN_INDICATORS:
-      array = g_ptr_array_new ();
+      array = g_ptr_array_new_full (1, indicator_config_free_array_element);
       for(li = config->known_indicators; li != NULL; li = li->next)
         {
           tmp = g_new0 (GValue, 1);
@@ -316,7 +327,7 @@ indicator_config_get_property (GObject    *object,
           g_ptr_array_add (array, tmp);
         }
       g_value_set_boxed (value, array);
-      xfconf_array_free (array);
+      g_ptr_array_unref (array);
       break;
 
     default:
@@ -402,8 +413,7 @@ indicator_config_set_property (GObject      *object,
       break;
 
     case PROP_KNOWN_INDICATORS:
-      g_list_foreach (config->known_indicators, (GFunc) g_free, NULL);
-      g_list_free (config->known_indicators);
+      g_list_free_full (config->known_indicators, g_free);
       config->known_indicators = NULL;
       array = g_value_get_boxed (value);
       if (G_LIKELY (array != NULL))

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list