We were returning junk memory here, because we didn't copy the value
authorHavoc Pennington <hp@redhat.com>
Thu, 19 Apr 2001 21:48:21 +0000 (21:48 +0000)
committerHavoc Pennington <hp@src.gnome.org>
Thu, 19 Apr 2001 21:48:21 +0000 (21:48 +0000)
2001-04-19  Havoc Pennington  <hp@redhat.com>

* gobject.c (g_object_get_valist): We were returning junk memory
here, because we didn't copy the value (G_VALUE_NOCOPY_CONTENTS
passed to G_VALUE_LCOPY) and then we freed the GValue immediately
after. Removed G_VALUE_NOCOPY_CONTENTS from here; need a
G_VALUE_STEAL_CONTENTS or the like if we want this optimization.

gobject/ChangeLog
gobject/gobject.c

index ad579b6..84dd1b5 100644 (file)
@@ -1,3 +1,11 @@
+2001-04-19  Havoc Pennington  <hp@redhat.com>
+
+       * gobject.c (g_object_get_valist): We were returning junk memory
+       here, because we didn't copy the value (G_VALUE_NOCOPY_CONTENTS
+       passed to G_VALUE_LCOPY) and then we freed the GValue immediately
+       after. Removed G_VALUE_NOCOPY_CONTENTS from here; need a
+       G_VALUE_STEAL_CONTENTS or the like if we want this optimization.
+
 Wed Apr 18 09:46:56 2001  Owen Taylor  <otaylor@redhat.com>
 
        * gobject.c gsignal.c: Change C++ comments for FIXME's to
index 7590c4c..0ee30a6 100644 (file)
@@ -983,7 +983,7 @@ g_object_get_valist (GObject         *object,
       
       object_get_property (object, pspec, &value);
       
-      G_VALUE_LCOPY (&value, var_args, G_VALUE_NOCOPY_CONTENTS, &error);
+      G_VALUE_LCOPY (&value, var_args, 0, &error);
       if (error)
        {
          g_warning ("%s: %s", G_STRLOC, error);