Re: changes to Glib::Object



muppet said:
- IMPORTANT: $object->set_data and get_data now store ONLY integer or string
  data, not perl scalars!  in the next release these functions will emit
warnings when you use them, to make sure you check your code.
  the replacement for this functionality is to store your data directly in
the hash.  consider GObject data a way to communicate with C functions,
not other perl functions.

corrections:

set_data and get_data are safe for unsigned integers, only.  yeah, you can
supply a GDestroyNotify function to set_data to avoid a leak, but how do you
know on the other end whether you've retrieved a string or a number?  you
can't.  only safe for integers.

and, actually, they will croak with a helpful message when you pass something
that is either a reference nor not a number.

-- 
muppet <scott at asofyet dot org>





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