fix missing call to g_type_class_unref in case of error. (#517563)
2008-02-20 Marc-Andre Lureau <marcandre.lureau@gmail.com> * gtk/gtkbuilder.c (_gtk_builder_enum_from_string): fix missing call to g_type_class_unref in case of error. (#517563) svn path=/trunk/; revision=19619
This commit is contained in:

committed by
Marc-Andre Lureau

parent
bd55012996
commit
e4fe214f39
@ -1,3 +1,8 @@
|
|||||||
|
2008-02-20 Marc-Andre Lureau <marcandre.lureau@gmail.com>
|
||||||
|
|
||||||
|
* gtk/gtkbuilder.c (_gtk_builder_enum_from_string): fix missing
|
||||||
|
call to g_type_class_unref in case of error. (#517563)
|
||||||
|
|
||||||
2008-02-18 Sven Neumann <sven@gimp.org>
|
2008-02-18 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
* gtk/Makefile.am (STOCK_ICONS)
|
* gtk/Makefile.am (STOCK_ICONS)
|
||||||
|
@ -1265,10 +1265,13 @@ _gtk_builder_enum_from_string (GType type,
|
|||||||
GEnumValue *ev;
|
GEnumValue *ev;
|
||||||
gchar *endptr;
|
gchar *endptr;
|
||||||
gint value;
|
gint value;
|
||||||
|
gboolean ret;
|
||||||
|
|
||||||
g_return_val_if_fail (G_TYPE_IS_ENUM (type), 0);
|
g_return_val_if_fail (G_TYPE_IS_ENUM (type), FALSE);
|
||||||
g_return_val_if_fail (string != NULL, 0);
|
g_return_val_if_fail (string != NULL, FALSE);
|
||||||
|
|
||||||
|
ret = TRUE;
|
||||||
|
|
||||||
value = strtoul (string, &endptr, 0);
|
value = strtoul (string, &endptr, 0);
|
||||||
if (endptr != string) /* parsed a number */
|
if (endptr != string) /* parsed a number */
|
||||||
*enum_value = value;
|
*enum_value = value;
|
||||||
@ -1288,13 +1291,13 @@ _gtk_builder_enum_from_string (GType type,
|
|||||||
GTK_BUILDER_ERROR_INVALID_VALUE,
|
GTK_BUILDER_ERROR_INVALID_VALUE,
|
||||||
"Could not parse enum: `%s'",
|
"Could not parse enum: `%s'",
|
||||||
string);
|
string);
|
||||||
return FALSE;
|
ret = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_type_class_unref (eclass);
|
g_type_class_unref (eclass);
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
@ -1305,15 +1308,15 @@ _gtk_builder_flags_from_string (GType type,
|
|||||||
{
|
{
|
||||||
GFlagsClass *fclass;
|
GFlagsClass *fclass;
|
||||||
gchar *endptr, *prevptr;
|
gchar *endptr, *prevptr;
|
||||||
guint i, j, ret, value;
|
guint i, j, value;
|
||||||
gchar *flagstr;
|
gchar *flagstr;
|
||||||
GFlagsValue *fv;
|
GFlagsValue *fv;
|
||||||
const gchar *flag;
|
const gchar *flag;
|
||||||
gunichar ch;
|
gunichar ch;
|
||||||
gboolean eos;
|
gboolean eos, ret;
|
||||||
|
|
||||||
g_return_val_if_fail (G_TYPE_IS_FLAGS (type), 0);
|
g_return_val_if_fail (G_TYPE_IS_FLAGS (type), FALSE);
|
||||||
g_return_val_if_fail (string != 0, 0);
|
g_return_val_if_fail (string != 0, FALSE);
|
||||||
|
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user