Web lists-archives.org

Reference counting




Hi,

I'm slightly overwhelmed as to the whole reference counting issue. Could 
someone explain the though process or logic behind the reference 
counting or direct me to some information where I can find the correct 
use. For example, in my code I set up my combo boxes on startup using 
gtk_list_store_newv and gtk_combo_box_set_model. (Do I need to unref the 
list_store pointer at this stage?) 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? 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?

I hope this explains the gaps in my understanding/knowledge. Any 
feedback is greatly appreciated.


Alwin

"Let's toast to insanity and dreams 'cause the are the only reasonable 
things on Earth" -- James Michegener --

_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list