mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-28 11:31:16 +00:00
virDomainObjListNew: Use virObjectFreeHashData
There's no point in duplicating virObjectFreeHashData() in a separate function. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
c88b796682
commit
fd65bee759
@ -1032,13 +1032,6 @@ virDomainDeviceDefCheckUnsupportedMemoryDevice(virDomainDeviceDefPtr dev)
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
virDomainObjListDataFree(void *payload, const void *name ATTRIBUTE_UNUSED)
|
||||
{
|
||||
virDomainObjPtr obj = payload;
|
||||
virObjectUnref(obj);
|
||||
}
|
||||
|
||||
virDomainObjListPtr virDomainObjListNew(void)
|
||||
{
|
||||
virDomainObjListPtr doms;
|
||||
@ -1049,7 +1042,7 @@ virDomainObjListPtr virDomainObjListNew(void)
|
||||
if (!(doms = virObjectLockableNew(virDomainObjListClass)))
|
||||
return NULL;
|
||||
|
||||
if (!(doms->objs = virHashCreate(50, virDomainObjListDataFree))) {
|
||||
if (!(doms->objs = virHashCreate(50, virObjectFreeHashData))) {
|
||||
virObjectUnref(doms);
|
||||
return NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user