[gnome-settings-daemon] xsettings: Don't poke at an empty hashtable



commit 9054d2321acb592cb8223e76b591ce232a91a77e
Author: Bastien Nocera <hadess hadess net>
Date:   Tue Aug 30 15:51:57 2011 +0100

    xsettings: Don't poke at an empty hashtable
    
    We might not like the result.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=657464

 plugins/xsettings/gsd-xsettings-gtk.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/plugins/xsettings/gsd-xsettings-gtk.c b/plugins/xsettings/gsd-xsettings-gtk.c
index 494ac77..0ce4db7 100644
--- a/plugins/xsettings/gsd-xsettings-gtk.c
+++ b/plugins/xsettings/gsd-xsettings-gtk.c
@@ -76,8 +76,10 @@ cond_setting_changed (GSettings       *settings,
 
         enabled = g_settings_get_boolean (settings, key);
         if (enabled != FALSE) {
+                if (gtk->priv->dir_modules == NULL) {
+                        gtk->priv->dir_modules = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
                 g_hash_table_insert (gtk->priv->dir_modules, g_strdup (module_name), NULL);
-        } else {
+        } else if (gtk->priv->dir_modules != NULL) {
                 g_hash_table_remove (gtk->priv->dir_modules, module_name);
         }
 



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