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

Re: [libvirt] [libvirt-glib] Add async variant of gvir_domain_get_info()



On Thu, Apr 19, 2012 at 04:45:29PM +0300, Zeeshan Ali (Khattak) wrote:
> From: "Zeeshan Ali (Khattak)" <zeeshanak gnome org>
> 
> ---
>  libvirt-gobject/libvirt-gobject-domain.c |   74 ++++++++++++++++++++++++++++++
>  libvirt-gobject/libvirt-gobject-domain.h |    7 +++
>  libvirt-gobject/libvirt-gobject.sym      |    4 +-
>  3 files changed, 84 insertions(+), 1 deletions(-)
> 
> diff --git a/libvirt-gobject/libvirt-gobject-domain.c b/libvirt-gobject/libvirt-gobject-domain.c
> index 0bafa7e..c1a2086 100644
> --- a/libvirt-gobject/libvirt-gobject-domain.c
> +++ b/libvirt-gobject/libvirt-gobject-domain.c
> @@ -572,6 +572,80 @@ GVirDomainInfo *gvir_domain_get_info(GVirDomain *dom,
>      return ret;
>  }
>  
> +static void
> +gvir_domain_get_info_helper(GSimpleAsyncResult *res,
> +                            GObject *object,
> +                            GCancellable *cancellable G_GNUC_UNUSED)
> +{
> +    GVirDomain *dom = GVIR_DOMAIN(object);
> +    GVirDomainInfo *info;
> +    GError *err = NULL;
> +
> +    info = gvir_domain_get_info(dom, &err);
> +    if (err)
> +        g_simple_async_result_take_error(res, err);
> +    else
> +        g_simple_async_result_set_op_res_gpointer(res, info, NULL);

I still think this can leak memory in error cases/corner cases, see my answer to
your first patch.

Christophe

Attachment: pgpYFJM8iuRVT.pgp
Description: PGP signature


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