[glib/wip/gsubprocess-ostreams: 1/9] gclosure: do not copy and leak when generically marshalling return value



commit 5e9f1f2bf470a5c366281dba9324256094cda1f1
Author: Mark Nauwelaerts <mark nauwelaerts collabora co uk>
Date:   Wed Apr 25 14:21:06 2012 +0200

    gclosure: do not copy and leak when generically marshalling return value
    
    https://bugzilla.gnome.org/show_bug.cgi?id=674800

 gobject/gclosure.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gobject/gclosure.c b/gobject/gclosure.c
index c027315..3ceba2f 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,10 +1267,10 @@ 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);



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