Re: Release memory for a GtkWindow



zze-coframi balr001 <coframi balr001 rd francetelecom com> writes:
The example code I put on my first name was created by Glade. 
So if I understand correctly, I just need to put 

        GtkWidget * button = gtk_button_new ();       
        gtk_widget_set_name (button, "button"); 
        gtk_widget_show (button); 
        gtk_object_set_data_full (GTK_OBJECT (window), "button", button,
(GtkDestroyNotify) gtk_widget_unref); 
        gtk_container_add (GTK_CONTAINER (window), button); 


No, that will free the button twice. ;-)

You might want to read the "GtkObject" overview docs in GTK 2 API
manual. I think they cover the "floating" reference count.

Havoc



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