Re: GType GString is not registered with gperl at Glib/Object/Introspection.pm



On Sun, Nov 6, 2011 at 22:36, Torsten Schoenfeld <kaffeetisch gmx de> wrote:
On 06.11.2011 22:18, Emmanuel Rodriguez wrote:

On Sun, Nov 6, 2011 at 21:44, Torsten Schoenfeld<kaffeetisch gmx de>
Âwrote:

On 06.11.2011 21:25, Emmanuel Rodriguez wrote:

*** unhandled exception in callback:
*** Â GType GString (156083704) is not registered with gperl at
/usr/local/lib/perl/5.12.4/Glib/Object/Introspection.pm line 57.
*** Âignoring at /usr/local/share/perl/5.12.4/Gtk3.pm line 104.

This comes from the code in Glib that handles boxed types. ÂIt turns out
that we don't have a boxed wrapper for G_TYPE_GSTRING. Â(To our defense,
this WebKit API is the first instance of GString occurring in an API that
I've seen.) ÂThe boxed wrapper would most likely be a very thin shell
around
newSVpv and SvPV. ÂThe G_TYPE_STRV wrapper might serve as an example.

(this time with a *reply to all*, sorry Torsten for the spam)

I can add the box type to Gtk3::WebKit but shouldn't it be better to
add it to Glib?

Yes, it should live in Glib.


I have a basic implementation based on your input [1]. Can you review my patch?

I don't know if I have to add a 'GPerlBoxedDestroyFunc', I'm guessing
that Perl's standard SV free should do fine.
I looked at the documentation of GString [2] and I don't see when
GString was first added to Glib which makes me guess that it has
always existed so there's no need of a #if GLIB_CHECK_VERSION() check.

[1] https://github.com/potyl/perl-Glib/commit/a69fb0dfa1e6c9e393949618d7a77a3cf913bc22
[2] http://developer.gnome.org/glib/2.30/glib-Strings.html

What I don't get is that it was working fine previously. I was able to
do $data->{str} to access the content of the string.

That sounds like GString was handled as a bare struct back then, not as a
boxed type. ÂMaybe g-ir-scanner changed in the meantime, or maybe the Perl
bindings.
Yes, I don't recall exactly when things changed I've upgraded all my
packages (webkit, perl-Glib, perl-Glib-Object-Introspection) and
suddenly the errors started to appear. I downgraded the perl packages
but the errors still remained.

-- 
Emmanuel Rodriguez



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