GNOME Bugzilla – Bug 663881
Add support for GString
Last modified: 2011-11-13 14:50:35 UTC
Created attachment 201252 [details] [review] Patch for GString WebKit returns a GString which is a glib type and this causes some problems in Gtk3::WebKit. I propose a patch that can fix the problem.
Review of attachment 201252 [details] [review]: I pushed the change with the change described below. Thank you for the patch! [Normally, we don't add features like this in a stable branch (which master currently is), but I figured it's fine this case.] ::: GBoxed.xs @@ +689,3 @@ + + ptr = SvPV(sv, len); + gstr = g_string_new_len ( ptr, len ); The unwrap functions are not supposed to allocate new memory. In the default boxed handler, unwrap simply returns the stored pointer to the object. But that of course doesn't work for types which we convert to and from native types, like in the GString case. The usual pattern then is to use gperl_alloc_temp to allocate memory that will be freed at the end of the current lexical scope.