From bd160edddfa0331a8f4f5f79db6d86aae3bcd04d Mon Sep 17 00:00:00 2001 From: Jonathan Blandford Date: Fri, 14 Feb 2003 00:02:50 +0000 Subject: [PATCH] Patch from Kjartan Maraas to fix a bunch of leaks. Thu Feb 13 18:51:37 2003 Jonathan Blandford * capplets/common/gconf-property-editor.c: (gconf_peditor_new): * capplets/common/gnome-theme-info.c: (read_meta_theme), (update_theme_index), (update_common_theme_dir_index), (top_theme_dir_changed), (top_icon_theme_dir_changed), (add_common_theme_dir_monitor), (real_add_top_theme_dir_monitor): * capplets/default-applications/gnome-default-applications-properti es.c: (initialize_default_applications), (read_editor), (read_terminal): * capplets/file-types/mime-edit-dialog.c: (fill_dialog): * capplets/file-types/mime-type-info.c: (load_all_mime_types): * capplets/file-types/mime-types-model.c: (mime_types_model_get_value): * capplets/font/main.c: (font_render_get_gconf), (enum_group_load): * capplets/mouse/gnome-mouse-properties.c: (read_cursor_font), (cursor_changed): * capplets/theme-switcher/gnome-theme-details.c: (window_theme_selection_changed): * capplets/theme-switcher/gnome-theme-manager.c: (meta_theme_selection_changed): * capplets/theme-switcher/theme-thumbnail.c: (generate_theme_thumbnail): * libsounds/sound-properties.c: (sound_properties_add_directory), (sound_properties_add_file): * libsounds/sound-view.c: (compare_func): * libwindow-settings/gnome-window-manager.c: (gnome_window_manager_new): Patch from Kjartan Maraas to fix a bunch of leaks. --- ChangeLog | 30 +++++++ capplets/common/gconf-property-editor.c | 3 +- capplets/common/gnome-theme-info.c | 86 ++++++++++++------- .../gnome-default-applications-properties.c | 20 ++++- capplets/file-types/mime-edit-dialog.c | 9 +- capplets/file-types/mime-type-info.c | 1 + capplets/file-types/mime-types-model.c | 7 +- capplets/font/main.c | 10 ++- capplets/mouse/gnome-mouse-properties.c | 8 +- capplets/theme-switcher/gnome-theme-details.c | 2 +- capplets/theme-switcher/gnome-theme-manager.c | 1 + capplets/theme-switcher/theme-thumbnail.c | 3 +- libwindow-settings/gnome-window-manager.c | 4 + 13 files changed, 138 insertions(+), 46 deletions(-) diff --git a/ChangeLog b/ChangeLog index afedd5dda..5d3474fe7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,33 @@ +Thu Feb 13 18:51:37 2003 Jonathan Blandford + + * capplets/common/gconf-property-editor.c: (gconf_peditor_new): + * capplets/common/gnome-theme-info.c: (read_meta_theme), + (update_theme_index), (update_common_theme_dir_index), + (top_theme_dir_changed), (top_icon_theme_dir_changed), + (add_common_theme_dir_monitor), (real_add_top_theme_dir_monitor): + * capplets/default-applications/gnome-default-applications-properti + es.c: (initialize_default_applications), (read_editor), + (read_terminal): + * capplets/file-types/mime-edit-dialog.c: (fill_dialog): + * capplets/file-types/mime-type-info.c: (load_all_mime_types): + * capplets/file-types/mime-types-model.c: + (mime_types_model_get_value): + * capplets/font/main.c: (font_render_get_gconf), (enum_group_load): + * capplets/mouse/gnome-mouse-properties.c: (read_cursor_font), + (cursor_changed): + * capplets/theme-switcher/gnome-theme-details.c: + (window_theme_selection_changed): + * capplets/theme-switcher/gnome-theme-manager.c: + (meta_theme_selection_changed): + * capplets/theme-switcher/theme-thumbnail.c: + (generate_theme_thumbnail): + * libsounds/sound-properties.c: (sound_properties_add_directory), + (sound_properties_add_file): + * libsounds/sound-view.c: (compare_func): + * libwindow-settings/gnome-window-manager.c: + (gnome_window_manager_new): Patch from Kjartan Maraas to fix a + bunch of leaks. + Tue Feb 4 17:09:18 2003 Jonathan Blandford * Release 2.2.0.1 diff --git a/capplets/common/gconf-property-editor.c b/capplets/common/gconf-property-editor.c index a62a5c614..0d11c069f 100644 --- a/capplets/common/gconf-property-editor.c +++ b/capplets/common/gconf-property-editor.c @@ -373,7 +373,8 @@ gconf_peditor_new (gchar *key, gconf_entry = gconf_client_get_entry (client, GCONF_PROPERTY_EDITOR (obj)->p->key, NULL, TRUE, NULL); GCONF_PROPERTY_EDITOR (obj)->p->callback (client, 0, gconf_entry, obj); GCONF_PROPERTY_EDITOR (obj)->p->inited = TRUE; - + gconf_entry_free (gconf_entry); + return obj; } diff --git a/capplets/common/gnome-theme-info.c b/capplets/common/gnome-theme-info.c index 5f649bb94..0e3d518ad 100644 --- a/capplets/common/gnome-theme-info.c +++ b/capplets/common/gnome-theme-info.c @@ -364,7 +364,9 @@ read_meta_theme (GnomeVFSURI *meta_theme_uri) str = gnome_desktop_item_get_string (meta_theme_ditem, BACKGROUND_IMAGE_KEY); if (str != NULL) meta_theme_info->background_image = g_strdup (str); - + + gnome_desktop_item_unref (meta_theme_ditem); + return meta_theme_info; } @@ -476,7 +478,7 @@ update_theme_index (GnomeVFSURI *index_uri, GnomeThemeElement key_element, gint priority) { - GnomeVFSFileInfo file_info = {0,}; + GnomeVFSFileInfo *file_info; GnomeVFSResult result; gboolean theme_exists; GnomeThemeInfo *theme_info; @@ -486,11 +488,13 @@ update_theme_index (GnomeVFSURI *index_uri, /* First, we determine the new state of the file. We do no more * sophisticated a test than "files exists and is a file" */ - result = gnome_vfs_get_file_info_uri (index_uri, &file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS); - if (result == GNOME_VFS_OK && file_info.type == GNOME_VFS_FILE_TYPE_REGULAR) + file_info = gnome_vfs_file_info_new (); + result = gnome_vfs_get_file_info_uri (index_uri, file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS); + if (result == GNOME_VFS_OK && file_info->type == GNOME_VFS_FILE_TYPE_REGULAR) theme_exists = TRUE; else theme_exists = FALSE; + gnome_vfs_file_info_unref (file_info); /* Next, we see what currently exists */ parent = gnome_vfs_uri_get_parent (index_uri); @@ -595,7 +599,7 @@ update_common_theme_dir_index (GnomeVFSURI *theme_index_uri, gboolean icon_theme, gint priority) { - GnomeVFSFileInfo file_info = {0,}; + GnomeVFSFileInfo *file_info; GnomeVFSResult result; gboolean theme_exists; gpointer theme_info; @@ -617,8 +621,9 @@ update_common_theme_dir_index (GnomeVFSURI *theme_index_uri, hash_by_name = meta_theme_hash_by_name; } /* First, we determine the new state of the file. */ - result = gnome_vfs_get_file_info_uri (theme_index_uri, &file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS); - if (result == GNOME_VFS_OK && file_info.type == GNOME_VFS_FILE_TYPE_REGULAR) + file_info = gnome_vfs_file_info_new (); + result = gnome_vfs_get_file_info_uri (theme_index_uri, file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS); + if (result == GNOME_VFS_OK && file_info->type == GNOME_VFS_FILE_TYPE_REGULAR) { /* It's an interesting file. Lets try to load it. */ if (icon_theme) @@ -653,6 +658,7 @@ update_common_theme_dir_index (GnomeVFSURI *theme_index_uri, theme_info = NULL; theme_exists = FALSE; } + gnome_vfs_file_info_unref (file_info); /* Next, we see what currently exists */ common_theme_dir_uri = gnome_vfs_uri_get_parent (theme_index_uri); @@ -912,16 +918,18 @@ top_theme_dir_changed (GnomeVFSMonitorHandle *handle, if (event_type == GNOME_VFS_MONITOR_EVENT_CREATED) { - GnomeVFSFileInfo file_info = {0,}; + GnomeVFSFileInfo *file_info; monitor_data = g_new0 (CommonThemeDirMonitorData, 1); monitor_data->priority = priority; - result = gnome_vfs_get_file_info_uri (common_theme_dir_uri, &file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS); - if (result == GNOME_VFS_OK && file_info.type == GNOME_VFS_FILE_TYPE_DIRECTORY) + file_info = gnome_vfs_file_info_new (); + result = gnome_vfs_get_file_info_uri (common_theme_dir_uri, file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS); + if (result == GNOME_VFS_OK && file_info->type == GNOME_VFS_FILE_TYPE_DIRECTORY) { add_common_theme_dir_monitor (common_theme_dir_uri, NULL, monitor_data, NULL); - g_hash_table_insert (handle_hash, file_info.name, monitor_data); + g_hash_table_insert (handle_hash, file_info->name, monitor_data); } + gnome_vfs_file_info_unref (file_info); } else if (event_type == GNOME_VFS_MONITOR_EVENT_DELETED) { @@ -962,16 +970,18 @@ top_icon_theme_dir_changed (GnomeVFSMonitorHandle *handle, if (event_type == GNOME_VFS_MONITOR_EVENT_CREATED) { - GnomeVFSFileInfo file_info = {0,}; + GnomeVFSFileInfo *file_info; monitor_data = g_new0 (CommonIconThemeDirMonitorData, 1); monitor_data->priority = priority; - result = gnome_vfs_get_file_info_uri (common_icon_theme_dir_uri, &file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS); - if (result == GNOME_VFS_OK && file_info.type == GNOME_VFS_FILE_TYPE_DIRECTORY) + file_info = gnome_vfs_file_info_new (); + result = gnome_vfs_get_file_info_uri (common_icon_theme_dir_uri, file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS); + if (result == GNOME_VFS_OK && file_info->type == GNOME_VFS_FILE_TYPE_DIRECTORY) { add_common_icon_theme_dir_monitor (common_icon_theme_dir_uri, NULL, monitor_data, NULL); - g_hash_table_insert (handle_hash, file_info.name, monitor_data); + g_hash_table_insert (handle_hash, file_info->name, monitor_data); } + gnome_vfs_file_info_unref (file_info); } else if (event_type == GNOME_VFS_MONITOR_EVENT_DELETED) { @@ -1004,7 +1014,7 @@ add_common_theme_dir_monitor (GnomeVFSURI *theme_dir_uri, gboolean real_monitor_not_added = FALSE; GnomeVFSURI *subdir; GnomeVFSURI *index_uri; - GnomeVFSFileInfo file_info = {0,}; + GnomeVFSFileInfo *file_info; index_uri = gnome_vfs_uri_append_file_name (theme_dir_uri, "index.theme"); update_meta_theme_index (index_uri, monitor_data->priority); @@ -1026,8 +1036,9 @@ add_common_theme_dir_monitor (GnomeVFSURI *theme_dir_uri, /* gtk-2 theme subdir */ subdir = gnome_vfs_uri_append_path (theme_dir_uri, "gtk-2.0"); - result = gnome_vfs_get_file_info_uri (theme_dir_uri, &file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS); - if (result == GNOME_VFS_OK && file_info.type == GNOME_VFS_FILE_TYPE_DIRECTORY) + file_info = gnome_vfs_file_info_new (); + result = gnome_vfs_get_file_info_uri (theme_dir_uri, file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS); + if (result == GNOME_VFS_OK && file_info->type == GNOME_VFS_FILE_TYPE_DIRECTORY) { index_uri = gnome_vfs_uri_append_file_name (subdir, "gtkrc"); update_gtk2_index (index_uri, monitor_data->priority); @@ -1046,8 +1057,9 @@ add_common_theme_dir_monitor (GnomeVFSURI *theme_dir_uri, /* keybinding theme subdir */ subdir = gnome_vfs_uri_append_path (theme_dir_uri, "gtk-2.0-key"); - result = gnome_vfs_get_file_info_uri (theme_dir_uri, &file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS); - if (result == GNOME_VFS_OK && file_info.type == GNOME_VFS_FILE_TYPE_DIRECTORY) + gnome_vfs_file_info_clear (file_info); + result = gnome_vfs_get_file_info_uri (theme_dir_uri, file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS); + if (result == GNOME_VFS_OK && file_info->type == GNOME_VFS_FILE_TYPE_DIRECTORY) { index_uri = gnome_vfs_uri_append_file_name (subdir, "gtkrc"); update_keybinding_index (index_uri, monitor_data->priority); @@ -1066,8 +1078,9 @@ add_common_theme_dir_monitor (GnomeVFSURI *theme_dir_uri, /* metacity theme subdir */ subdir = gnome_vfs_uri_append_path (theme_dir_uri, "metacity-1"); - result = gnome_vfs_get_file_info_uri (theme_dir_uri, &file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS); - if (file_info.type == GNOME_VFS_FILE_TYPE_DIRECTORY) + gnome_vfs_file_info_clear (file_info); + result = gnome_vfs_get_file_info_uri (theme_dir_uri, file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS); + if (file_info->type == GNOME_VFS_FILE_TYPE_DIRECTORY) { index_uri = gnome_vfs_uri_append_file_name (subdir, "metacity-theme-1.xml"); update_metacity_index (index_uri, monitor_data->priority); @@ -1082,6 +1095,7 @@ add_common_theme_dir_monitor (GnomeVFSURI *theme_dir_uri, g_free (uri_string); if (result == GNOME_VFS_ERROR_NOT_SUPPORTED) real_monitor_not_added = TRUE; + gnome_vfs_file_info_unref (file_info); gnome_vfs_uri_unref (subdir); if (monitor_not_added) @@ -1156,7 +1170,7 @@ real_add_top_theme_dir_monitor (GnomeVFSURI *uri, GnomeVFSMonitorHandle *monitor_handle = NULL; GnomeVFSDirectoryHandle *directory_handle = NULL; GnomeVFSResult result; - GnomeVFSFileInfo file_info = {0,}; + GnomeVFSFileInfo *file_info; gchar *uri_string; CallbackTuple *tuple; @@ -1168,9 +1182,13 @@ real_add_top_theme_dir_monitor (GnomeVFSURI *uri, tuple->priority = priority; /* Check the URI */ - gnome_vfs_get_file_info_uri (uri, &file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS); - if (file_info.type != GNOME_VFS_FILE_TYPE_DIRECTORY) + file_info = gnome_vfs_file_info_new (); + gnome_vfs_get_file_info_uri (uri, file_info, GNOME_VFS_FILE_INFO_FOLLOW_LINKS); + if (file_info->type != GNOME_VFS_FILE_TYPE_DIRECTORY) { + gnome_vfs_file_info_unref (file_info); return GNOME_VFS_ERROR_NOT_A_DIRECTORY; + } + gnome_vfs_file_info_unref (file_info); /* Monitor the top directory */ uri_string = gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_NONE); @@ -1193,18 +1211,23 @@ real_add_top_theme_dir_monitor (GnomeVFSURI *uri, if (result != GNOME_VFS_OK) return result; - while (gnome_vfs_directory_read_next (directory_handle, &file_info) == GNOME_VFS_OK) + file_info = gnome_vfs_file_info_new (); + while (gnome_vfs_directory_read_next (directory_handle, file_info) == GNOME_VFS_OK) { GnomeVFSURI *theme_dir_uri; gpointer monitor_data; - if (file_info.type != GNOME_VFS_FILE_TYPE_DIRECTORY) + if (file_info->type != GNOME_VFS_FILE_TYPE_DIRECTORY) { + gnome_vfs_file_info_clear (file_info); continue; - if (file_info.name[0] == '.') + } + if (file_info->name[0] == '.') { + gnome_vfs_file_info_clear (file_info); continue; + } /* Add the directory */ - theme_dir_uri = gnome_vfs_uri_append_path (uri, file_info.name); + theme_dir_uri = gnome_vfs_uri_append_path (uri, file_info->name); if (icon_theme) { monitor_data = g_new0 (CommonIconThemeDirMonitorData, 1); @@ -1219,10 +1242,13 @@ real_add_top_theme_dir_monitor (GnomeVFSURI *uri, } - g_hash_table_insert (tuple->handle_hash, file_info.name, monitor_data); + g_hash_table_insert (tuple->handle_hash, file_info->name, monitor_data); + gnome_vfs_file_info_clear (file_info); gnome_vfs_uri_unref (theme_dir_uri); } + gnome_vfs_file_info_unref (file_info); + gnome_vfs_directory_close (directory_handle); if (result != GNOME_VFS_ERROR_EOF) return result; diff --git a/capplets/default-applications/gnome-default-applications-properties.c b/capplets/default-applications/gnome-default-applications-properties.c index e939310a1..09bb4fa10 100644 --- a/capplets/default-applications/gnome-default-applications-properties.c +++ b/capplets/default-applications/gnome-default-applications-properties.c @@ -185,16 +185,25 @@ initialize_default_applications (void) text_editors = gnome_vfs_mime_get_all_applications ("text/plain"); for (i = 0; i < G_N_ELEMENTS (possible_browsers); i++ ) { - if (g_find_program_in_path (possible_browsers[i].executable_name)) + gchar *browsers = g_find_program_in_path (possible_browsers[i].executable_name); + if (browsers) { possible_browsers[i].in_path = TRUE; + g_free(browsers); + } } for (i = 0; i < G_N_ELEMENTS (possible_help_viewers); i++ ) { - if (g_find_program_in_path (possible_help_viewers[i].executable_name)) + gchar *help_viewers = g_find_program_in_path (possible_help_viewers[i].executable_name); + if (help_viewers) { possible_help_viewers[i].in_path = TRUE; + g_free (help_viewers); + } } for (i = 0; i < G_N_ELEMENTS (possible_terminals); i++ ) { - if (g_find_program_in_path (possible_terminals[i].exec)) + gchar *terminals = g_find_program_in_path (possible_terminals[i].exec); + if (terminals) { possible_terminals[i].in_path = TRUE; + g_free (terminals); + } } } @@ -230,6 +239,7 @@ read_editor (GConfClient *client, gtk_entry_set_text (GTK_ENTRY (WID ("text_select_combo_entry")), mime_app->name); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("text_custom_radio")), TRUE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("text_select_radio")), TRUE); + gnome_vfs_mime_application_free (mime_app); return; } } @@ -252,6 +262,8 @@ read_editor (GConfClient *client, read_editor_custom: gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("text_select_radio")), TRUE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("text_custom_radio")), TRUE); + if (mime_app) + gnome_vfs_mime_application_free (mime_app); } static void @@ -495,6 +507,8 @@ read_terminal (GConfClient *client, _(possible_terminals[i].name)); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("terminal_custom_radio")), TRUE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (WID ("terminal_select_radio")), TRUE); + g_free (exec); + g_free (exec_arg); return; } } diff --git a/capplets/file-types/mime-edit-dialog.c b/capplets/file-types/mime-edit-dialog.c index c22837a29..c3c89cce4 100644 --- a/capplets/file-types/mime-edit-dialog.c +++ b/capplets/file-types/mime-edit-dialog.c @@ -455,6 +455,8 @@ safe_set_entry (MimeEditDialog *dialog, char const *widget, char const *txt) static void fill_dialog (MimeEditDialog *dialog) { + gchar *category_name; + g_return_if_fail (dialog->p->info != NULL); mime_type_info_load_all (dialog->p->info); @@ -463,9 +465,10 @@ fill_dialog (MimeEditDialog *dialog) dialog->p->info->description); safe_set_entry (dialog, "mime_type_entry", dialog->p->info->mime_type); - safe_set_entry (dialog, "category_entry", - mime_type_info_get_category_name (dialog->p->info)); - + category_name = mime_type_info_get_category_name (dialog->p->info); + safe_set_entry (dialog, "category_entry", category_name); + g_free (category_name); + update_sensitivity (dialog); gnome_icon_entry_set_filename (GNOME_ICON_ENTRY (WID ("icon_entry")), mime_type_info_get_icon_path (dialog->p->info)); diff --git a/capplets/file-types/mime-type-info.c b/capplets/file-types/mime-type-info.c index 72fbab8e8..6261f720f 100644 --- a/capplets/file-types/mime-type-info.c +++ b/capplets/file-types/mime-type-info.c @@ -69,6 +69,7 @@ load_all_mime_types (GtkTreeModel *model) for (tmp = list; tmp != NULL; tmp = tmp->next) mime_type_info_new (tmp->data, model); + g_list_free (tmp); g_list_free (list); } diff --git a/capplets/file-types/mime-types-model.c b/capplets/file-types/mime-types-model.c index 493062883..5522d0ab1 100644 --- a/capplets/file-types/mime-types-model.c +++ b/capplets/file-types/mime-types-model.c @@ -374,7 +374,8 @@ mime_types_model_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, gint co MimeTypesModel *model; ModelEntry *entry; GdkPixbuf *icon; - + gchar *pretty_string; + g_return_if_fail (tree_model != NULL); g_return_if_fail (IS_MIME_TYPES_MODEL (tree_model)); @@ -454,7 +455,9 @@ mime_types_model_get_value (GtkTreeModel *tree_model, GtkTreeIter *iter, gint co switch (entry->type) { case MODEL_ENTRY_MIME_TYPE: - g_value_set_string (value, mime_type_info_get_file_extensions_pretty_string (MIME_TYPE_INFO (entry))); + pretty_string = mime_type_info_get_file_extensions_pretty_string (MIME_TYPE_INFO (entry)); + g_value_set_string (value, pretty_string); + g_free (pretty_string); break; case MODEL_ENTRY_SERVICE: diff --git a/capplets/font/main.c b/capplets/font/main.c index f4cf5cc31..5b5eb0ca7 100644 --- a/capplets/font/main.c +++ b/capplets/font/main.c @@ -306,13 +306,17 @@ font_render_get_gconf (Antialiasing *antialiasing, int val; val = ANTIALIAS_GRAYSCALE; - if (antialias_str) + if (antialias_str) { gconf_string_to_enum (antialias_enums, antialias_str, &val); + g_free (antialias_str); + } *antialiasing = val; val = HINT_FULL; - if (hint_str) + if (hint_str) { gconf_string_to_enum (hint_enums, hint_str, &val); + g_free (hint_str); + } *hinting = val; g_object_unref (client); @@ -531,6 +535,8 @@ enum_group_load (EnumGroup *group) if (str) gconf_string_to_enum (group->enums, str, &val); + g_free (str); + in_change = TRUE; for (tmp_list = group->items; tmp_list; tmp_list = tmp_list->next) { diff --git a/capplets/mouse/gnome-mouse-properties.c b/capplets/mouse/gnome-mouse-properties.c index 7b310dc02..0751c9b85 100644 --- a/capplets/mouse/gnome-mouse-properties.c +++ b/capplets/mouse/gnome-mouse-properties.c @@ -391,7 +391,8 @@ read_cursor_font (void) } g_free (link_name); } - + g_free (dir_name); + closedir (dir); return NULL; } @@ -459,10 +460,11 @@ cursor_changed (GtkTreeSelection *selection, gtk_tree_model_get (model, &iter, COLUMN_FONT_PATH, &cursor_font, -1); - if (cursor_font != NULL) + if (cursor_font != NULL) { gconf_client_set_string (gconf_client_get_default (), CURSOR_FONT_KEY, cursor_font, NULL); - else + g_free (cursor_font); + } else gconf_client_unset (gconf_client_get_default (), CURSOR_FONT_KEY, NULL); } diff --git a/capplets/theme-switcher/gnome-theme-details.c b/capplets/theme-switcher/gnome-theme-details.c index 6aaaa756a..a814d47ca 100644 --- a/capplets/theme-switcher/gnome-theme-details.c +++ b/capplets/theme-switcher/gnome-theme-details.c @@ -158,7 +158,7 @@ window_theme_selection_changed (GtkTreeSelection *selection, wm_settings.theme = window_theme_name; gnome_window_manager_change_settings (window_manager, &wm_settings); } - + g_free (window_theme_name); } static void diff --git a/capplets/theme-switcher/gnome-theme-manager.c b/capplets/theme-switcher/gnome-theme-manager.c index 8e8453741..9c08319bc 100644 --- a/capplets/theme-switcher/gnome-theme-manager.c +++ b/capplets/theme-switcher/gnome-theme-manager.c @@ -575,6 +575,7 @@ meta_theme_selection_changed (GtkTreeSelection *selection, if (meta_theme_name) { meta_theme_info = gnome_theme_meta_info_find (meta_theme_name); + g_free (meta_theme_name); } else { diff --git a/capplets/theme-switcher/theme-thumbnail.c b/capplets/theme-switcher/theme-thumbnail.c index 16d6e58fc..57c78587d 100644 --- a/capplets/theme-switcher/theme-thumbnail.c +++ b/capplets/theme-switcher/theme-thumbnail.c @@ -496,7 +496,8 @@ generate_theme_thumbnail (GnomeThemeMetaInfo *meta_theme_info, } retval = gdk_pixbuf_scale_simple (pixbuf, ICON_SIZE_WIDTH/2, ICON_SIZE_HEIGHT/2, GDK_INTERP_BILINEAR); - + g_object_unref (pixbuf); + g_hash_table_insert (theme_hash, meta_theme_info->name, retval); return retval; } diff --git a/libwindow-settings/gnome-window-manager.c b/libwindow-settings/gnome-window-manager.c index ae867af2a..840e1e976 100644 --- a/libwindow-settings/gnome-window-manager.c +++ b/libwindow-settings/gnome-window-manager.c @@ -52,6 +52,7 @@ gnome_window_manager_new (GnomeDesktopItem *it) module = g_module_open (module_name, G_MODULE_BIND_LAZY); if (module == NULL) { g_warning ("Couldn't load window manager settings module `%s' (%s)", module_name, g_module_error ()); + g_free (module_name); return NULL; } @@ -60,9 +61,12 @@ gnome_window_manager_new (GnomeDesktopItem *it) if ((!success) || wm_new_func == NULL) { g_warning ("Couldn't load window manager settings module `%s`, couldn't find symbol \'window_manager_new\'", module_name); + g_free (module_name); return NULL; } + g_free (module_name); + wm = (* wm_new_func) (GNOME_WINDOW_MANAGER_INTERFACE_VERSION); if (wm == NULL)