Patch from Christian Kirbach to prevent a critical warning crasher when

2006-01-21  Elijah Newren  <newren gmail com>

	Patch from Christian Kirbach to prevent a critical warning crasher
	when switching themes.  #327847.

	* src/theme.c (meta_theme_free): since themes are only constructed
	as needed and may be NULL, check for that before freeing theme
	hash tables
This commit is contained in:
Elijah Newren 2006-01-21 21:26:55 +00:00 committed by Elijah Newren
parent 8808c8b500
commit 9ce85d7657
2 changed files with 23 additions and 6 deletions

View File

@ -1,3 +1,12 @@
2006-01-21 Elijah Newren <newren gmail com>
Patch from Christian Kirbach to prevent a critical warning crasher
when switching themes. #327847.
* src/theme.c (meta_theme_free): since themes are only constructed
as needed and may be NULL, check for that before freeing theme
hash tables
2006-01-21 Elijah Newren <newren gmail com>
* src/common.h (enum MetaActionDoubleClickTitlebar):

View File

@ -4533,12 +4533,20 @@ meta_theme_free (MetaTheme *theme)
g_free (theme->author);
g_free (theme->copyright);
g_hash_table_destroy (theme->integer_constants);
g_hash_table_destroy (theme->images_by_filename);
g_hash_table_destroy (theme->layouts_by_name);
g_hash_table_destroy (theme->draw_op_lists_by_name);
g_hash_table_destroy (theme->styles_by_name);
g_hash_table_destroy (theme->style_sets_by_name);
/* be more careful when destroying the theme hash tables,
since they are only constructed as needed, and may be NULL. */
if (theme->integer_constants)
g_hash_table_destroy (theme->integer_constants);
if (theme->images_by_filename)
g_hash_table_destroy (theme->images_by_filename);
if (theme->layouts_by_name)
g_hash_table_destroy (theme->layouts_by_name);
if (theme->draw_op_lists_by_name)
g_hash_table_destroy (theme->draw_op_lists_by_name);
if (theme->styles_by_name)
g_hash_table_destroy (theme->styles_by_name);
if (theme->style_sets_by_name)
g_hash_table_destroy (theme->style_sets_by_name);
i = 0;
while (i < META_FRAME_TYPE_LAST)