https://bugzilla.gnome.org/show_bug.cgi?id=663881
gnome-perl | Glib | unspecified
Torsten Schoenfeld <kaffeetisch> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #201252|none |committed
status| |
--- Comment #1 from Torsten Schoenfeld <kaf...@gm...> 2011-11-13 14:49:49 UTC ---
Review of attachment 201252:
--> (https://bugzilla.gnome.org/review?bug=663881&attachment=201252)
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.
--
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
|