don't crash if the color string is mangled, and close a small memory leak
2007-04-03 Jens Granseuer <jensgr@gmx.net> * gnome-theme-details.c: (update_color_buttons_from_string): don't crash if the color string is mangled, and close a small memory leak svn path=/trunk/; revision=7439
This commit is contained in:
parent
66283c87ed
commit
7eeb3afb39
2 changed files with 23 additions and 18 deletions
|
@ -1,3 +1,9 @@
|
|||
2007-04-03 Jens Granseuer <jensgr@gmx.net>
|
||||
|
||||
* gnome-theme-details.c: (update_color_buttons_from_string):
|
||||
don't crash if the color string is mangled, and close a small
|
||||
memory leak
|
||||
|
||||
2007-03-21 Frederic Crozat <fcrozat@mandriva.com>
|
||||
|
||||
* gnome-theme-details.c: (update_color_scheme_tab):
|
||||
|
|
|
@ -902,13 +902,11 @@ update_color_buttons_from_string (gchar *color_scheme)
|
|||
{
|
||||
color_scheme_pair = g_strsplit (current_string, ":", 0);
|
||||
|
||||
if (color_scheme_pair[0] == NULL)
|
||||
continue;
|
||||
|
||||
if (color_scheme_pair[0] != NULL && color_scheme_pair[1] != NULL)
|
||||
{
|
||||
g_strstrip (color_scheme_pair[0]);
|
||||
g_strstrip (color_scheme_pair[1]);
|
||||
|
||||
|
||||
if (!strcmp ("fg_color", color_scheme_pair[0]))
|
||||
gdk_color_parse (color_scheme_pair[1], &color_scheme_colors[0]);
|
||||
else if (!strcmp ("bg_color", color_scheme_pair[0]))
|
||||
|
@ -921,6 +919,7 @@ update_color_buttons_from_string (gchar *color_scheme)
|
|||
gdk_color_parse (color_scheme_pair[1], &color_scheme_colors[4]);
|
||||
else if (!strcmp ("selected_bg_color", color_scheme_pair[0]))
|
||||
gdk_color_parse (color_scheme_pair[1], &color_scheme_colors[5]);
|
||||
}
|
||||
|
||||
g_strfreev (color_scheme_pair);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue