g_object_ref and g_object_unref in widget implementations



Hi,

I am writing my own widget, and while looking at the widgets in GTK I notice the following.

If a widget draws on its parent GdkWindow, you generally see

widget->window = gtk_widget_get_parent_window (widget);
g_object_ref (widget->window);

But widget->window is not g_object_unref-ed anywhere in the widget implementation. Why shouldn't it?


Thanks,
Bastiaan.






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