gtk+ r19619 - in trunk: . gtk
- From: malureau svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk+ r19619 - in trunk: . gtk
- Date: Wed, 20 Feb 2008 18:32:44 +0000 (GMT)
Author: malureau
Date: Wed Feb 20 18:32:43 2008
New Revision: 19619
URL: http://svn.gnome.org/viewvc/gtk+?rev=19619&view=rev
Log:
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)
Modified:
trunk/ChangeLog
trunk/gtk/gtkbuilder.c
Modified: trunk/gtk/gtkbuilder.c
==============================================================================
--- trunk/gtk/gtkbuilder.c (original)
+++ trunk/gtk/gtkbuilder.c Wed Feb 20 18:32:43 2008
@@ -1265,10 +1265,13 @@
GEnumValue *ev;
gchar *endptr;
gint value;
+ gboolean ret;
- g_return_val_if_fail (G_TYPE_IS_ENUM (type), 0);
- g_return_val_if_fail (string != NULL, 0);
+ g_return_val_if_fail (G_TYPE_IS_ENUM (type), FALSE);
+ g_return_val_if_fail (string != NULL, FALSE);
+ ret = TRUE;
+
value = strtoul (string, &endptr, 0);
if (endptr != string) /* parsed a number */
*enum_value = value;
@@ -1288,13 +1291,13 @@
GTK_BUILDER_ERROR_INVALID_VALUE,
"Could not parse enum: `%s'",
string);
- return FALSE;
+ ret = FALSE;
}
g_type_class_unref (eclass);
}
- return TRUE;
+ return ret;
}
gboolean
@@ -1305,15 +1308,15 @@
{
GFlagsClass *fclass;
gchar *endptr, *prevptr;
- guint i, j, ret, value;
+ guint i, j, value;
gchar *flagstr;
GFlagsValue *fv;
const gchar *flag;
gunichar ch;
- gboolean eos;
+ gboolean eos, ret;
- g_return_val_if_fail (G_TYPE_IS_FLAGS (type), 0);
- g_return_val_if_fail (string != 0, 0);
+ g_return_val_if_fail (G_TYPE_IS_FLAGS (type), FALSE);
+ g_return_val_if_fail (string != 0, FALSE);
ret = TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]