Re: GtkAccelGroup - when to deallocate?



"Norman Black" <stonybrk ix netcom com> writes: 
I notice that accel groups have a reference counting mechanism and no
"sink". I assume accel groups start (after "new")  with a reference count of
1?

Does gtk_window_add_accel_group increment the accel group reference count?
Does gtk_window_add_accel_group decrement the accel group reference count
when removed, or destroyed?

In other words once I add the accel group to the window I can do an unref
and the accel group will auto deallocate when the window dies.

Yes, accel groups start with a refcount of 1, and add_accel_group adds
its own count, so you add the accel group, then remove your reference,
and it will go away with the dialog.

This is how non-object refcounts work throughout GTK (or at least how
they are supposed to work).

Havoc




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