Re: RFC: Handling of floating references
- From: muppet <scott asofyet org>
- To: Torsten Schoenfeld <kaffeetisch gmx de>
- Cc: gtk-perl-list gnome org
- Subject: Re: RFC: Handling of floating references
- Date: Mon, 22 Aug 2011 07:36:57 -0400
On Aug 21, 2011, at 1:34 PM, Torsten Schoenfeld wrote:
The attached patch generalizes the way we handle objects with floating references (for example,
Glib::InitiallyUnowned descendants) such that it becomes correct also for Glib::Object::Introspection. The
patch contains the rationale. Can anyone see something wrong with this?
Looks good to me.
You might be wondering why I didn't take the following approach: Register a custom sink func for
GInitiallyUnowned that does ref_sink+unref, and then in gperl_object_new simply enforce own=1 for
GInitiallyUnowned descendants. This would indeed be mostly equivalent to the patch, and would conceptually
be cleaner. But I worry that their might be some weird class out there that does not descend from
GInitiallyUnowned to get floating ref behavior but instead uses gobject's floating refs manually, via
Sallah! I said no camels! That's five camels! Can't you count?
-- Indiana Jones
] [Thread Prev