GNOME Bugzilla – Bug 131076
Bad GBoxed type usage in gsourceclosure
Last modified: 2004-12-22 21:47:04 UTC
In g_io_channel_get_type(): our_type = g_boxed_type_register_static ("GIOChannel", (GBoxedCopyFunc) g_io_channel_ref, (GBoxedFreeFunc) g_io_channel_unref); The GBoxed code relies on the GBoxedCopyFunc associated with a type to return a gpointer. However, g_io_channel_ref returns void, so the value is undefined. Possible solutions are: 1) API change, make g_io_channel_ref return its GIOChannel * instead of void. 2) Implement a private copy function in gsourceclosure.c to wrap g_io_channel_ref and return the GIOChannel * itself. I prefer solution #1, but since it's an API change I'm filing it here for others to comment instead of just committing a fix.
g_io_channel_ref() should return the referenced object as all _ref() functions should. basta, issue fixed ;)
fwiw, g_main_context_ref, g_hook_ref, g_async_queue_ref, and g_async_queue_ref_unlocked all return void currently as well.
Sun Jan 11 15:34:35 2004 Manish Singh <yosh@gimp.org> * gsourceclosure.c: wrap g_io_channel_ref in a function that returns the passed in GIOChannel, so we aren't abusing GBoxedCopyFunc semantics. Fixes bug #131076. Should open a bug for 2.6 regarding the inconsistent ref APIs.