Re: Trouble finding GIR constructor for Soup.Cookie



Il giorno sab, 23/07/2011 alle 16.21 -0400, Jasper St. Pierre ha
scritto:
> 
> 
> 2011/7/23 Ricardo Gladwell <ricardo gladwell gmail com>
>         The following is also crashing my Gnome Shell session despite
>         being
>         surrounded by a try...catch block:
>         
>                    let cookieJar = new Soup.CookieJar();
>                    let cookie = Soup.Cookie.prototype.new('SID',
>         this.sid,
>         '.google.com', '/', -1);
>                    cookieJar.add_cookie(cookie);
>                    session.add_feature(cookieJar); 
>         Any ideas why?
>         
> 
> If it's what I think it is, it's an unfortunate bug between
> gobject-introspection, gjs and libsoup. See, the API defines a few
> properties called 'add-feature' and 'add-feature-by-type', designed
> for the C API:
> 
>   g_object_new (SOUP_TYPE_SESSION,
>     "add-feature-by-type", SOUP_TYPE_PROXY_RESOLVER_DEFAULT,
>     NULL);
> 
> But this is interfering with gobject-introspection, and gjs is
> thinking it's the property it wants when you do "session.add_feature".
> Unfortunately, they don't give it a proper getter, so we get stuck
> with a warning, and maybe a crash. See BGO bug #655149 [0] and bug
> #655150 [1] for details. Unfortunately, this isn't fixed yet: gjs
> doesn't care about the typelib when looking for properties, it just
> looks them up on the typeinfo. I have a quick patch, but it's probably
> best if it goes into the girepository API proper.

It could also be crashing before, when calling
Soup.Cookie.prototype.new: in gjs 3.0 static methods are not flagged as
such (that's why they appear in .prototype instead of the constructor),
so they're passed an additional "instance" parameter at the beginning,
which is NULL for .prototype.

Giovanni


Attachment: signature.asc
Description: This is a digitally signed message part



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