[Gtk-sharp-list] Gtk.TreePath double free / TreeModelImplementor

Mike Kestner mkestner at gmail.com
Sun May 4 12:46:05 EDT 2008

On Sun, 2008-05-04 at 12:04 +0100, David A Knight wrote:
> On Tue, 2008-03-04 at 21:17 +0000, David A Knight wrote:
> > I have recently installed gtk-sharp from svn to play with
> > Gtk.TreeModelImplementor and have hit a slightly annoying problem, not
> > sure if it is my code at fault or a problem with gtk-sharp.
> > 
> > I have a Gtk.TreeModelImplementor which works with a List<T> to provide
> > a list view (seeing big memory savings where this works over a
> > Gtk.ListStore).  This seems to work great in some cases but in one
> > instance I have a constant problem with a double from of a Gtk.TreePath:
> > 
> >   at (wrapper managed-to-native) Gtk.TreePath.gtk_tree_path_free
> > (intptr) <0x0000b>
> >   at (wrapper managed-to-native) Gtk.TreePath.gtk_tree_path_free
> > (intptr) <0xffffffff>
> >   at Gtk.TreePath.Free (intptr) [0x00000]
> In case anyone else was wondering about this, my problem was I wasn't
> setting Owned to false on my Gtk.TreePaths.

FWIW, I believe the issue you were seeing was fixed on gtk-sharp trunk
on r100762 which introduced the OwnedCopy property for opaque types.
Before that patch, GetPath implementations would return a tree path
reference that wasn't really owned by the caller even though it was
supposed to be.

This fix will be in the next release of Gtk#.


More information about the Gtk-sharp-list mailing list