Re: toplevel g_object_unref segv



On 2/28/02 11:51 AM, "Carlos Romero" <caberome bellsouth net> wrote:

> this gives a segv in g_datalist_set_data_full()
> [...]
> w = gtk_window_new(GTK_WINDOW_TOPLEVEL);
> /* w = gtk_invisible_new() */
> gtk_widget_show(w);
> g_object_unref(G_OBJECT(w));

Yes, this is working as designed.

When you create a new window with gtk_window_new, you don't get a ref. The
window "owns itself", and it will unref itself when it's destroyed. To make
it go away, you can do gtk_object_destroy (GTK_OBJECT (w)).

(If you do a g_object_ref before that, it will be destroyed but not freed
until you do a g_object_unref.)

    -- Darin




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