Re: Patch for gtktoolbar.c
- From: Owen Taylor <otaylor redhat com>
- To: "Padraig O'Briain" <Padraig Obriain Sun COM>
- Cc: gtk-devel-list gnome org
- Subject: Re: Patch for gtktoolbar.c
- Date: Thu, 31 Oct 2002 11:14:29 -0500 (EST)
"Padraig O'Briain" <Padraig Obriain Sun COM> writes:
> While browsing the code I noticed a g_free() call after a return call.
>
> OK to commit patch?
Sure, looks fine. bugzilla is probably a bit better for things
like this.
Regards,
Owen
[
Random stat - in gtk+/
$ find . -name '*.c' | xargs grep 'return retval' | wc -l
139
$ find . -name '*.c' | xargs grep 'return result' | wc -l
94
$ find . -name '*.c' | xargs grep 'return return_val' | wc -l
33
$ find . -name '*.c' | xargs grep 'return return_value' | wc -l
1
]
> Padraig
> Index: gtktoolbar.c
> ===================================================================
> RCS file: /cvs/gnome/gtk+/gtk/gtktoolbar.c,v
> retrieving revision 1.79
> diff -u -p -r1.79 gtktoolbar.c
> --- gtktoolbar.c 25 Oct 2002 21:36:55 -0000 1.79
> +++ gtktoolbar.c 31 Oct 2002 10:52:43 -0000
> @@ -1138,6 +1138,7 @@ gtk_toolbar_insert_stock (GtkToolbar
> GtkWidget *image = NULL;
> const gchar *label;
> gchar *label_no_mnemonic;
> + GtkWidget *return_value;
>
> if (gtk_stock_lookup (stock_id, &item))
> {
> @@ -1149,16 +1150,18 @@ gtk_toolbar_insert_stock (GtkToolbar
>
> label_no_mnemonic = elide_underscores (label);
>
> - return gtk_toolbar_internal_insert_item (toolbar,
> - label_no_mnemonic,
> - tooltip_text,
> - tooltip_private_text,
> - image,
> - callback,
> - user_data,
> - position);
> + return_value = gtk_toolbar_internal_insert_item (toolbar,
> + label_no_mnemonic,
> + tooltip_text,
> + tooltip_private_text,
> + image,
> + callback,
> + user_data,
> + position);
>
> g_free (label_no_mnemonic);
> +
> + return return_value;
> }
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]