Re: Possible gtk_tree_view bug?



Jamie Strachan <frostfreek yahoo com> writes:

> The docs on GtkTreeView show a simple example:
> 
> > {
> >   :
> >   model = gtk_tree_store_new_with_values (1,
> G_TYPE_STRING);
> >
> >   /* Create a view */
> >   view = gtk_tree_view_new_with_model
> (GTK_TREE_MODEL (model));
> >
> >   /* The view now holds a reference.  */
> >   /* We can get rid of our own reference */
> >   g_object_unref (G_OBJECT (model));
> >   :
> >}
> 
> This does not appear to be the case: the model is NOT
> reffed within gtktreeview.c, and this example performs
> a segmentation fault at gtk_show(&view).
> GDB shows the refcount as 1 within the
> g_object_unref(model); call.

Whoops...

> Is the code correct, or is the documentation correct?
> I would suspect the doc is correct.

You'd be right in suspecting that.

> Shall I enter that as a bug in bugzilla?
> I have a patch, and can post it to bugzilla, if
> someone can confirm this is actually a bug.

No need -- it's a two line fix.  Next time I commit (prolly later today)
it'll go in.

Thanks for noticing that.

-Jonathan




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