Re: Subclasses, tied hashes, {get,set}_property, undefined values

On Nov 15, 2007, at 10:56 AM, Giuliano wrote:

 I ran into a strange behaviour with Glib::Object::Subclass .
 If I call set_property using a value stored in a tied hash, the
corresponding get_property returns undef. This doesn't happen if
scalar context is forced when calling set_property.

This seems to fix it, but i'm not sure what the complete repercussions of this change might be.

Index: GValue.xs
RCS file: /cvsroot/gtk2-perl/gtk2-perl-xs/Glib/GValue.xs,v
retrieving revision 1.20
diff -u -r1.20 GValue.xs
--- GValue.xs   13 Nov 2005 16:43:43 -0000      1.20
+++ GValue.xs   15 Nov 2007 16:37:26 -0000
@@ -66,6 +66,7 @@
        char* tmp;
        GType type;
+       SvGETMAGIC (sv);
        if (!sv || !SvOK (sv))
                return TRUE; /* use the GValue type's default */
        type = G_TYPE_FUNDAMENTAL (G_VALUE_TYPE (value));

elysse:  You dance better than some.
me:  "Some" what?
elysse:  Some asparagus.

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