Re: #51062 - Warning on finalization of floating object
- From: Maciej Stachowiak <mjs noisehavoc org>
- To: Owen Taylor <otaylor redhat com>
- Cc: gtk-devel-list gnome org, gnome-2-0-list gnome org
- Subject: Re: #51062 - Warning on finalization of floating object
- Date: Mon, 19 Nov 2001 17:49:52 -0800
On 19Nov2001 08:47PM (-0500), Owen Taylor wrote:
>
> Just noticed this bug in the list of bugs on the 2.0.0
> milestone. Question here is whether code like:
>
> GtkWidget *button = gtk_button_new ();
> gtk_widget_unref (button);
>
> Should produce a warning.
>
> This code is wrong because the until you claim ownersip
> by calling:
> gtk_widget_ref (button); gtk_widget_sink (button);
>
> The last reference on the widget is unowned and you
> can _never_ unref a reference you don't own.
>
> We could claim:
>
> - This isn't an API bug because the usage is clearly
> wrong and we are always free to add warnings
> about incorrect usage.
I think it is fair to not consider this an API bug for reasons
stated. Particularly since it only spews warnings, rather than making
existing code crash or fail to compile.
But better to do it sooner rather than later, perhaps once all the API
bugs are done.
Regards,
Maciej
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]