[Xfce4-commits] <xfce4-panel:devel> Fix crash when sending a NULL channel and shared table to binding.

Nick Schermer nick at xfce.org
Tue Aug 11 20:34:40 CEST 2009


Updating branch refs/heads/devel
         to cc446f9ea912454675131c3c9fe72f1d10175d11 (commit)
       from 25f2dd879c87472637eb924b39508482258af1c3 (commit)

commit cc446f9ea912454675131c3c9fe72f1d10175d11
Author: Nick Schermer <nick at xfce.org>
Date:   Mon Jun 1 21:22:29 2009 +0200

    Fix crash when sending a NULL channel and shared table to binding.

 common/panel-xfconf.c |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/common/panel-xfconf.c b/common/panel-xfconf.c
index 1414478..cf3855e 100644
--- a/common/panel-xfconf.c
+++ b/common/panel-xfconf.c
@@ -207,22 +207,25 @@ panel_properties_bind (XfconfChannel       *channel,
   panel_return_if_fail (property_base != NULL && *property_base == '/');
   panel_return_if_fail (properties != NULL);
 
-  /* get or ref the hash table */
-  if (save_properties)
-    hash_table = NULL;
-  else if (shared_hash_table != NULL)
-    hash_table = g_hash_table_ref (shared_hash_table);
-  else
-    hash_table = xfconf_channel_get_properties (channel, property_base);
-
   if (G_LIKELY (channel == NULL))
     {
       /* use the default channel if none is set by the user and take
        * care of refcounting */
       channel = panel_properties_get_channel ();
+      panel_return_if_fail (XFCONF_IS_CHANNEL (channel));
       g_object_weak_ref (G_OBJECT (object), (GWeakNotify) g_object_unref, channel);
     }
 
+  /* get or ref the hash table */
+  if (save_properties)
+    hash_table = NULL;
+  else if (shared_hash_table != NULL)
+    hash_table = g_hash_table_ref (shared_hash_table);
+  else if (channel != NULL)
+    hash_table = xfconf_channel_get_properties (channel, property_base);
+  else
+    panel_assert_not_reached ();
+
   /* walk the properties array */
   for (prop = properties; prop->property != NULL; prop++)
     {



More information about the Xfce4-commits mailing list