This is a question of how you interpret your application, think, do you
want to give the ownership of your data model to your view widget ?
Will you be having multiple list stores that you might want to keep
around and alternate the view ?
If you unref your list store (passing ownership to the combo box), then
destroying (freeing) the combo box will take care of finalizing (freeing)
the list store.
At a later stage I am ready to put
some data in the combo box, so I get the store (with
gtk_combo_box_get_model) and add some entries to the sore. Do I need to
unref the aquired pointer?
No. in general gtk_[widget]_get_[parameter]() functions never duplicate
strings or add references (strings are easier because they are always
const return values if they are not duplicated).
Usually a returned value that has a reference will note in the docs that
it must be unreffed (strings from g_object_get() are dupped and objects
refcount incremented for instance).
To make matters more confusing, I also have a
couple of combo's with filters. I wrote a little stub to acquire the store:
GtkTreeModel * gtk_combo_get_filter_model( GktComboBox * combo )
{
return gtk_tree_model_filter_get_model( GTK_TREE_MODEL_FILTER(
gtk_combo_box_get_model( combo ) ) );
}
Do I leak a reference here?
No.