Memory leaks in glib bindings

Colin Walters walters at verbum.org
Mon Jun 20 12:12:00 PDT 2005


On Mon, 2005-06-20 at 12:18 +0100, Ross Burton wrote:

> @@ -1570,20 +1573,21 @@
>  
>    dbus_message_iter_init_append (reply, &iter);
>  
> +  values = g_value_array_new (0);
>    va_start (args, context);
>    for (i = 0; i < argsig->len; i++)
>      {
> -      GValue value = {0,};
>        char *error;
> -      g_value_init (&value, g_array_index (argsig, GType, i));
> +      g_value_array_prepend (values, NULL);
> +      g_value_init (&values->values[0], g_array_index (argsig, GType,
> i));
>        error = NULL;
> -      G_VALUE_COLLECT (&value, args, 0, &error);
> +      G_VALUE_COLLECT (&values->values[0], args, 0, &error);
>        if (error)
>         {
>           g_warning(error);
>           g_free (error);
>         }
> -      dbus_gvalue_marshal (&iter, &value);
> +      dbus_gvalue_marshal (&iter, &values->values[0]);
>      }
>    va_end (args);

Isn't this just missing G_VALUE_NOCOPY_CONTENTS instead of 0 for
G_VALUE_COLLECT?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/dbus/attachments/20050620/0c5b7bf5/attachment.pgp


More information about the dbus mailing list