Re: gnome_vfs_uri_list_parse unwrapped?



Am Sonntag, den 14.01.2007, 21:10 +0000 schrieb John Spray:

> Here's an almost-working patch.  It works fine if I instead use
> std::list as the container for the return value, but something's causing
> a crash in the way I'm using Glib::ListHandle: I get a segfault when I
> try to dereference a child of the returned listhandle with a
> "g_object_get_qdata: assertion `G_IS_OBJECT (object)' failed" warning.

Cool, but you should patch the .ccg and .hg files instead.

> So hopefully you can easily spot what's wrong with the use of the
> container.

Yes.  Glib::ListHandle objects are used to defer the actual type
conversion to the point where the contents are accessed, and the
resulting container type is known.  So using std::list<> is wrong here,
you need to wrap the GList directly.

Unfortunately this is one of those situations where a special TypeTraits
class for GnomeVFSURI is required in order to be able to use the
Glib::*Handle classes.  IIRC pangomm contains quite a lot of these
custom traits structs, maybe you could have a look there for
inspiration.

--Daniel





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