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

Re: [libvirt] [libvirt-glib 23/37] Add test for adding a disk device



On Thu, Nov 10, 2011 at 9:33 PM, Christophe Fergeau <cfergeau redhat com> wrote:
>  devices = g_list_append(devices, disk);
> +    gvir_config_domain_set_devices(domain, devices);
> +    g_list_free(devices);
> +    devices = NULL;


Hmm, I realize this is a bit more tricky. You give up devices element
owner ship but no the container.. I think this is bad, as the list
contains invalid objects after leaving the functions. Insead, the
set_devices () function should ref the element, and the caller should
unref too with g_list_free_full (devices, g_object_unref)


-- 
Marc-André Lureau


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