Re: [PATCH 23/36] datatypes: convert virStorageVol to GObject

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

 



On Fri, 2020-04-03 at 17:15 +0200, Rafael Fonseca wrote:
> --- a/src/conf/virstorageobj.c
> +++ b/src/conf/virstorageobj.c
> @@ -1052,7 +1052,13 @@
> virStoragePoolObjVolumeListExport(virConnectPtr conn,
>      return data.nvols;
>  
>   error:
> -    virObjectListFree(data.vols);
> +    if (data.vols) {
> +        while (data.nvols--) {
> +            if (data.vols[data.nvols])
> +                g_object_unref(data.vols[data.nvols]);
> +        }
> +        VIR_FREE(data.vols);
> +    }
>      return -1;
>  }
>  

This pattern has been repeated several times now. Is it worth adding a
helper function that's equivalent to virObjectListFree but for
GObjects?




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux