Re: Reference Counting

2006-09-11 Thread Nikhil Dinesh
Reference counting for tree models doesn't behave the same way as for contained components. The tree view adds an additional reference to the model, so in your case your model is never destroyed as the ref count is 2. Try invoking: g_object_unref(model) after you add it to the view. My s

Re: Reference Counting

2006-09-11 Thread Matias Torres
tkWidget *window; GtkWidget *treeview; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title (GTK_WINDOW (window), "Reference Counting"); treeview = generate_tree_view (); gtk_tree_view_set_mode

Re: Reference Counting

2006-09-11 Thread Stefan Kost
the widget into a container, is it always this way??? Eg:* > > //*No reference counting on GtkEntry*// > GtkWidget *entry = gtk_entry_new (); > //*Reference counting starts here *// > gtk_container_add (GTK_CONTAINER (window), entry);/ > /* Another doubt: in this case, reference cou

Re: Reference Counting

2006-09-07 Thread Nikhil Dinesh
>> *- When reference count starts? I read somewhere that it starts when >>> you add the widget into a container, is it always this way??? Eg:* >>> >> Reference counting starts when an object is created. In your example: >> >>GtkWidget *entry = gt

Re: Reference Counting

2006-09-07 Thread Matias Torres
reference" to the model, > using g_object_weak_ref. See: > > http://developer.gnome.org/doc/API/2.0/gobject/gobject-The-Base-Object-Type.html > >> *- When reference count starts? I read somewhere that it starts when you >> add the widget into a container, is it always this

Re: Reference Counting

2006-09-06 Thread Nikhil Dinesh
" to the model, using g_object_weak_ref. See: http://developer.gnome.org/doc/API/2.0/gobject/gobject-The-Base-Object-Type.html > *- When reference count starts? I read somewhere that it starts when you > add the widget into a container, is it always this way??? Eg:* > Reference counting

Reference Counting

2006-09-06 Thread Matias Torres
reeModel so GTK frees the allocated space when the model's reference count reach to 0? (without registering it as a G_TYPE).* *- When reference count starts? I read somewhere that it starts when you add the widget into a container, is it always this way??? Eg:* //*No reference

Re: GIOChannel reference counting

2005-12-12 Thread Axel Simon
On Mon, 2005-12-12 at 10:56 +, Richard Warren wrote: > Dear all, > > I would be grateful if anyone could tell me whether I need to unreference a > GIOChannel in order to destroy it properly. > > Here's what I'm currently doing: > > 1. I create a channel with g_io_channel_unix_new() from a s

GIOChannel reference counting

2005-12-12 Thread Richard Warren
Dear all, I would be grateful if anyone could tell me whether I need to unreference a GIOChannel in order to destroy it properly. Here's what I'm currently doing: 1. I create a channel with g_io_channel_unix_new() from a socket. The docs state that the initial reference count will be 1. 2.