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
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
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
>> *- 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
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
" 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
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
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
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.