Re: Gtk+ leaks



Alexander Larsson <alla lysator liu se> writes:

> More leaks...
> Can I check in?

The changes look fine to me, with a few notes below.
 
> +  gobject_class->finalize = gtk_image_finalize;

While it's somewhat a matter of taste, I think I would clear
the contained objects in ::destroy, not ::finalize.

> +static void
> +gtk_image_finalize (GObject *object)
> +{
> +  GtkImage *image;
> +  
> +  g_return_if_fail (GTK_IS_IMAGE (object));

We generally avoid doing these types of checks in virtual
functions these days. The chances of a bug that would cause
this to trigger are absolutely miniscule, so this is just
code bloat and a cut-and-paste error waiting to happen.

>  static void
> -gtk_image_clear (GtkImage *image)
> +gtk_image_free (GtkImage *image)

I would suggest the naems:

 gtk_image_clear => gtk_image_reset ()
 gtk_image_free  => gtk_image_clear ()

Regards,
                                        Owen




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]