From: Manish Singh Date: Sun, 11 Jan 2004 23:59:49 +0000 (+0000) Subject: wrap g_io_channel_ref in a function that returns the passed in GIOChannel, X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=b4e2d28850c3cd829af9d7613a8fd483900fcc7c;p=dana%2Fcg-glib.git wrap g_io_channel_ref in a function that returns the passed in GIOChannel, Sun Jan 11 15:34:35 2004 Manish Singh * 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. --- diff --git a/gobject/ChangeLog b/gobject/ChangeLog index addda579..a767764d 100644 --- a/gobject/ChangeLog +++ b/gobject/ChangeLog @@ -1,3 +1,9 @@ +Sun Jan 11 15:34:35 2004 Manish Singh + + * 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. + Sat Jan 10 23:55:42 2004 Matthias Clasen * glib-mkenums.1: Document the lowercase_name trigraph option. diff --git a/gobject/gsourceclosure.c b/gobject/gsourceclosure.c index 62c1dc70..3db1317d 100644 --- a/gobject/gsourceclosure.c +++ b/gobject/gsourceclosure.c @@ -24,6 +24,16 @@ #include "gvalue.h" #include "gvaluetypes.h" +/* This is needed for a proper GBoxedCopyFunc, until the g_io_channel_ref API + * returns it's GIOChannel itself #131076. + */ +static GIOChannel * +wrap_g_io_channel_ref (GIOChannel *channel) +{ + g_io_channel_ref (channel); + return channel; +} + GType g_io_channel_get_type (void) { @@ -31,7 +41,7 @@ g_io_channel_get_type (void) if (our_type == 0) our_type = g_boxed_type_register_static ("GIOChannel", - (GBoxedCopyFunc) g_io_channel_ref, + (GBoxedCopyFunc) wrap_g_io_channel_ref, (GBoxedFreeFunc) g_io_channel_unref); return our_type;