Re: [gtk-list] Memory leak in Glade output?




On 11 Jul 1999, Anders Melchiorsen wrote:
> 
> 	gtk_widget_destroy(GTK_WIDGET(window));
> 
> and this worked flawlessly with previous versions of Glade. Is this no
> longer the correct way to close/free the window?
>

Yes, it is correct.
 
I'm not sure what's going on with Glade, but if you do this then your
program is probably right, so you can leave the bug to Glade.

Calling gtk_widget_unref() is definitely wrong; the window's ref count is
1, and since it's a toplevel container it will be unref'd during the
destroy anyway, so you're doing one too many unrefs (thus the warning). I
can't think of why this makes a difference in memory usage, since the
refcount reaches 0 either way.

Havoc




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