summaryrefslogtreecommitdiff
path: root/gobject/gclosure.c
diff options
context:
space:
mode:
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2012-04-25 14:21:06 +0200
committerTim-Philipp Müller <tim@centricular.net>2012-08-05 12:52:38 +0100
commit10fc00b38515bc322d5e497d61a50165b04c3c8d (patch)
treeb2969bc1d1f790187e7d918ba07b281f1ec08fcd /gobject/gclosure.c
parent24b9f61ee4b8b7bc755b84398207112c18b4121f (diff)
downloadglib-10fc00b38515bc322d5e497d61a50165b04c3c8d.tar.gz
gclosure: do not copy and leak when generically marshalling return value
https://bugzilla.gnome.org/show_bug.cgi?id=674800
Diffstat (limited to 'gobject/gclosure.c')
-rw-r--r--gobject/gclosure.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gobject/gclosure.c b/gobject/gclosure.c
index c0273154b..14647e831 100644
--- a/gobject/gclosure.c
+++ b/gobject/gclosure.c
@@ -1231,7 +1231,7 @@ value_from_ffi_type (GValue *gvalue, gpointer *value)
g_value_set_boolean (gvalue, (gboolean) *int_val);
break;
case G_TYPE_STRING:
- g_value_set_string (gvalue, *(gchar**)value);
+ g_value_take_string (gvalue, *(gchar**)value);
break;
case G_TYPE_CHAR:
g_value_set_schar (gvalue, (gint8) *int_val);
@@ -1258,7 +1258,7 @@ value_from_ffi_type (GValue *gvalue, gpointer *value)
g_value_set_uint64 (gvalue, (guint64) *int_val);
break;
case G_TYPE_BOXED:
- g_value_set_boxed (gvalue, *(gpointer*)value);
+ g_value_take_boxed (gvalue, *(gpointer*)value);
break;
case G_TYPE_ENUM:
g_value_set_enum (gvalue, (gint) *int_val);
@@ -1267,13 +1267,13 @@ value_from_ffi_type (GValue *gvalue, gpointer *value)
g_value_set_flags (gvalue, (guint) *int_val);
break;
case G_TYPE_PARAM:
- g_value_set_param (gvalue, *(gpointer*)value);
+ g_value_take_param (gvalue, *(gpointer*)value);
break;
case G_TYPE_OBJECT:
- g_value_set_object (gvalue, *(gpointer*)value);
+ g_value_take_object (gvalue, *(gpointer*)value);
break;
case G_TYPE_VARIANT:
- g_value_set_variant (gvalue, *(gpointer*)value);
+ g_value_take_variant (gvalue, *(gpointer*)value);
break;
default:
g_warning ("value_from_ffi_type: Unsupported fundamental type: %s",