From: Andrea Zagli Date: Wed, 4 Aug 2010 18:57:26 +0000 (+0200) Subject: Bugfix. X-Git-Tag: 0.1.4~1 X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;h=ce769d23d3a5a39edbab7a57e0c39bb517d7d13d;p=libgtkform Bugfix. --- diff --git a/src/form.c b/src/form.c index f2e3ea3..183a48c 100644 --- a/src/form.c +++ b/src/form.c @@ -1087,7 +1087,7 @@ GtkFormWidget } /** - * gtk_form_get_objects: + * gtk_form_get_widgets: * @form: a #GtkForm object. * * Returns: an array of all the #GtkWidget into the form. Must be free. @@ -1116,7 +1116,14 @@ GtkWidget while (fields != NULL) { l++; - ret = g_realloc (ret, l * sizeof (GtkWidget *)); + if (l == 1) + { + ret = g_malloc (sizeof (GtkWidget *)); + } + else + { + ret = g_realloc (ret, l * sizeof (GtkWidget *)); + } form_widget = gtk_form_field_get_form_widget ((GtkFormField *)fields->data); widget = gtk_form_widget_get_widget (form_widget);