diff options
author | Kjartan Maraas <kmaraas@src.gnome.org> | 2003-04-29 19:37:34 +0000 |
---|---|---|
committer | Kjartan Maraas <kmaraas@src.gnome.org> | 2003-04-29 19:37:34 +0000 |
commit | 3fb5f240ae071273d663d830d4a07f6511931fbd (patch) | |
tree | 58c3544c78630d6e44d1a88726f3ab8faaa5ded6 | |
parent | a3e69e90793987185f824555e04ed965967bb84d (diff) | |
download | gnome-control-center-3fb5f240ae071273d663d830d4a07f6511931fbd.tar.gz |
Hmm? Broken pipe?
-rw-r--r-- | capplets/theme-switcher/ChangeLog | 6 | ||||
-rw-r--r-- | capplets/theme-switcher/theme-thumbnail.c | 7 | ||||
-rw-r--r-- | control-center/ChangeLog | 4 | ||||
-rw-r--r-- | control-center/capplet-dir.c | 7 |
4 files changed, 19 insertions, 5 deletions
diff --git a/capplets/theme-switcher/ChangeLog b/capplets/theme-switcher/ChangeLog index aea3157e0..453c52adf 100644 --- a/capplets/theme-switcher/ChangeLog +++ b/capplets/theme-switcher/ChangeLog @@ -1,3 +1,9 @@ +2003-04-29 Kjartan Maraas <kmaraas@gnome.org> + + * theme-thumbnail.c: (message_from_capplet), (message_from_child), + (generate_theme_thumbnail), (theme_thumbnail_factory_init): Plug + leaks and guard against invalid reads reported by valgrind. + Wed Feb 5 17:03:26 2003 Jonathan Blandford <jrb@gnome.org> * gnome-theme-manager.[ch] (get_default_string_from_key): get the diff --git a/capplets/theme-switcher/theme-thumbnail.c b/capplets/theme-switcher/theme-thumbnail.c index 57c78587d..f9e8549a4 100644 --- a/capplets/theme-switcher/theme-thumbnail.c +++ b/capplets/theme-switcher/theme-thumbnail.c @@ -349,6 +349,7 @@ message_from_capplet (GIOChannel *source, { write (pipe_from_factory_fd[1], pixels + (rowstride)*i, ICON_SIZE_WIDTH * gdk_pixbuf_get_n_channels (pixbuf)); } + g_object_unref (pixbuf); theme_thumbnail_data->status = READY_FOR_THEME; g_byte_array_set_size (theme_thumbnail_data->control_theme_name, 0); g_byte_array_set_size (theme_thumbnail_data->wm_theme_name, 0); @@ -404,7 +405,7 @@ message_from_child (GIOChannel *source, memcpy (pixels + rowstride * i, async_data.data->data + 4 * ICON_SIZE_WIDTH * i, ICON_SIZE_WIDTH * 4); scaled_pixbuf = gdk_pixbuf_scale_simple (pixbuf, ICON_SIZE_WIDTH/2, ICON_SIZE_HEIGHT/2, GDK_INTERP_BILINEAR); - g_hash_table_insert (theme_hash, async_data.meta_theme_name, scaled_pixbuf); + g_hash_table_insert (theme_hash, g_strdup(async_data.meta_theme_name), scaled_pixbuf); g_object_unref (pixbuf); (* async_data.func) (scaled_pixbuf, async_data.user_data); @@ -498,7 +499,7 @@ 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); + g_hash_table_insert (theme_hash, g_strdup (meta_theme_info->name), retval); return retval; } @@ -590,5 +591,5 @@ theme_thumbnail_factory_init (int argc, char *argv[]) async_data.meta_theme_name = NULL; async_data.data = g_byte_array_new (); - theme_hash = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_object_unref); + theme_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); } diff --git a/control-center/ChangeLog b/control-center/ChangeLog index 1d364eb83..445686717 100644 --- a/control-center/ChangeLog +++ b/control-center/ChangeLog @@ -1,3 +1,7 @@ +2003-04-29 Kjartan Maraas <set EMAIL_ADDRESS environment variable> + + * capplet-dir.c: (read_entries): Plug a couple of leaks. + Tue Feb 4 17:09:18 2003 Jonathan Blandford <jrb@redhat.com> * Release 2.2.0.1 diff --git a/control-center/capplet-dir.c b/control-center/capplet-dir.c index 09a43cd7d..30e6eee71 100644 --- a/control-center/capplet-dir.c +++ b/control-center/capplet-dir.c @@ -347,9 +347,11 @@ read_entries (CappletDir *dir) result = gnome_vfs_directory_open_from_uri (&parent_dir, CAPPLET_DIR_ENTRY (dir)->uri, GNOME_VFS_FILE_INFO_DEFAULT); - if (result != GNOME_VFS_OK) + if (result != GNOME_VFS_OK) { + gnome_vfs_file_info_unref (child); return NULL; - + } + while ( gnome_vfs_directory_read_next (parent_dir, child) == GNOME_VFS_OK ) { if (child->name[0] == '.') continue; @@ -375,6 +377,7 @@ read_entries (CappletDir *dir) g_free (fullpath); } + gnome_vfs_file_info_unref (child); gnome_vfs_directory_close (parent_dir); list = g_slist_sort (list, node_compare); |