This change hopefully fixes bug #484797 which I suspect is caused by the

2007-10-24  Jens Granseuer  <jensgr@gmx.net>

	This change hopefully fixes bug #484797 which I suspect is caused by
	the capplet getting stale data from from the themes module which in
	turn is caused by deleted themes being freed but not removed from the
	hash cache.

	* gnome-theme-info.c: (update_common_theme_dir_index): actually remove
	theme data from the hash when the theme gets deleted; also don't
	unconditionally cast to icon theme

svn path=/trunk/; revision=8194
This commit is contained in:
Jens Granseuer 2007-10-24 21:18:10 +00:00 committed by Jens Granseuer
parent cb02196087
commit d420730347
2 changed files with 22 additions and 6 deletions

View file

@ -1,3 +1,14 @@
2007-10-24 Jens Granseuer <jensgr@gmx.net>
This change hopefully fixes bug #484797 which I suspect is caused by
the capplet getting stale data from from the themes module which in
turn is caused by deleted themes being freed but not removed from the
hash cache.
* gnome-theme-info.c: (update_common_theme_dir_index): actually remove
theme data from the hash when the theme gets deleted; also don't
unconditionally cast to icon theme
2007-10-14 Jens Granseuer <jensgr@gmx.net>
* gnome-theme-info.c: (gnome_theme_init): fix invalid use after free I

View file

@ -588,7 +588,7 @@ update_common_theme_dir_index (GnomeVFSURI *theme_index_uri,
gchar *common_theme_dir;
GHashTable *hash_by_uri;
GHashTable *hash_by_name;
gchar *name = NULL;
const gchar *name = NULL;
if (icon_theme)
{
@ -653,6 +653,7 @@ update_common_theme_dir_index (GnomeVFSURI *theme_index_uri,
else
name = ((GnomeThemeMetaInfo *)theme_info)->name;
}
if (old_theme_info == NULL)
{
if (theme_exists)
@ -665,6 +666,12 @@ update_common_theme_dir_index (GnomeVFSURI *theme_index_uri,
}
else
{
const gchar *old_name;
if (icon_theme)
old_name = ((GnomeThemeIconInfo *)old_theme_info)->name;
else
old_name = ((GnomeThemeMetaInfo *)old_theme_info)->name;
if (theme_exists)
{
gint cmp;
@ -678,7 +685,7 @@ update_common_theme_dir_index (GnomeVFSURI *theme_index_uri,
{
/* Remove old theme */
g_hash_table_remove (hash_by_uri, common_theme_dir);
remove_data_from_hash_by_name (hash_by_name, ((GnomeThemeIconInfo *)old_theme_info)->name, old_theme_info);
remove_data_from_hash_by_name (hash_by_name, old_name, old_theme_info);
g_hash_table_insert (hash_by_uri, g_strdup (common_theme_dir), theme_info);
add_data_to_hash_by_name (hash_by_name, name, theme_info);
handle_change_signal (icon_theme?GNOME_THEME_TYPE_ICON:GNOME_THEME_TYPE_METATHEME,
@ -698,10 +705,8 @@ update_common_theme_dir_index (GnomeVFSURI *theme_index_uri,
}
else
{
if (icon_theme)
name = ((GnomeThemeIconInfo *)old_theme_info)->name;
else
name = ((GnomeThemeMetaInfo *)old_theme_info)->name;
g_hash_table_remove (hash_by_uri, common_theme_dir);
remove_data_from_hash_by_name (hash_by_name, old_name, old_theme_info);
handle_change_signal (icon_theme?GNOME_THEME_TYPE_ICON:GNOME_THEME_TYPE_METATHEME,
old_theme_info, GNOME_THEME_CHANGE_DELETED, 0);