summaryrefslogtreecommitdiff
path: root/gnome-settings-daemon/gnome-settings-manager.c
diff options
context:
space:
mode:
authorWilliam Jon McCann <jmccann@redhat.com>2008-03-24 19:45:19 +0000
committerWilliam Jon McCann <mccann@src.gnome.org>2008-03-24 19:45:19 +0000
commited54a9bcbd3760f422a24b590f5dd1706c3747c1 (patch)
tree5f7ecd082c6adff2480ee446f8a6a1ac83cb344c /gnome-settings-daemon/gnome-settings-manager.c
parent0e70ca449ba84b6eedb2c55327d0156a7f34fad6 (diff)
downloadgnome-settings-daemon-ed54a9bcbd3760f422a24b590f5dd1706c3747c1.tar.gz
Fix a refcounting bug. Add a few more checks. Fix up a leak. Fixes #524183
2008-03-24 William Jon McCann <jmccann@redhat.com> * gnome-settings-daemon/gnome-settings-manager.c: (compare_location), (_load_file), (_load_dir): * gnome-settings-daemon/gnome-settings-plugin-info.c: (debug_info), (gnome_settings_plugin_info_fill_from_file), (gnome_settings_plugin_info_deactivate), (load_plugin_module), (gnome_settings_plugin_info_activate), (gnome_settings_plugin_info_is_active), (gnome_settings_plugin_info_get_enabled), (gnome_settings_plugin_info_is_available), (gnome_settings_plugin_info_get_name), (gnome_settings_plugin_info_get_description), (gnome_settings_plugin_info_get_authors), (gnome_settings_plugin_info_get_website), (gnome_settings_plugin_info_get_copyright), (gnome_settings_plugin_info_get_location), (gnome_settings_plugin_info_get_priority), (gnome_settings_plugin_info_set_priority): Fix a refcounting bug. Add a few more checks. Fix up a leak. Fixes #524183 svn path=/trunk/; revision=231
Diffstat (limited to 'gnome-settings-daemon/gnome-settings-manager.c')
-rw-r--r--gnome-settings-daemon/gnome-settings-manager.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/gnome-settings-daemon/gnome-settings-manager.c b/gnome-settings-daemon/gnome-settings-manager.c
index 6fed76b7..9dae056e 100644
--- a/gnome-settings-daemon/gnome-settings-manager.c
+++ b/gnome-settings-daemon/gnome-settings-manager.c
@@ -111,6 +111,10 @@ compare_location (GnomeSettingsPluginInfo *a,
loc_a = gnome_settings_plugin_info_get_location (a);
loc_b = gnome_settings_plugin_info_get_location (b);
+ if (loc_a == NULL || loc_b == NULL) {
+ return -1;
+ }
+
return strcmp (loc_a, loc_b);
}
@@ -175,8 +179,8 @@ _load_file (GnomeSettingsManager *manager,
goto out;
}
- /* list takes ownership of ref */
- manager->priv->plugins = g_slist_prepend (manager->priv->plugins, info);
+ manager->priv->plugins = g_slist_prepend (manager->priv->plugins,
+ g_object_ref (info));
g_signal_connect (info, "activated",
G_CALLBACK (on_plugin_activated), manager);
@@ -239,8 +243,9 @@ _load_dir (GnomeSettingsManager *manager,
while ((name = g_dir_read_name (d))) {
char *filename;
- if (!g_str_has_suffix (name, PLUGIN_EXT))
+ if (!g_str_has_suffix (name, PLUGIN_EXT)) {
continue;
+ }
filename = g_build_filename (path, name, NULL);
if (g_file_test (filename, G_FILE_TEST_IS_REGULAR)) {