RFC: Handling of floating references



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?

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 g_object_force_floating.

Attachment: 0001-Handle-ownership-of-objects-with-floating-refs-corre.patch
Description: Text Data



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