提交 fd65bee7 编写于 作者: M Michal Privoznik

virDomainObjListNew: Use virObjectFreeHashData

There's no point in duplicating virObjectFreeHashData() in a separate
function.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 c88b7966
...@@ -1032,13 +1032,6 @@ virDomainDeviceDefCheckUnsupportedMemoryDevice(virDomainDeviceDefPtr dev) ...@@ -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 virDomainObjListNew(void)
{ {
virDomainObjListPtr doms; virDomainObjListPtr doms;
...@@ -1049,7 +1042,7 @@ virDomainObjListPtr virDomainObjListNew(void) ...@@ -1049,7 +1042,7 @@ virDomainObjListPtr virDomainObjListNew(void)
if (!(doms = virObjectLockableNew(virDomainObjListClass))) if (!(doms = virObjectLockableNew(virDomainObjListClass)))
return NULL; return NULL;
if (!(doms->objs = virHashCreate(50, virDomainObjListDataFree))) { if (!(doms->objs = virHashCreate(50, virObjectFreeHashData))) {
virObjectUnref(doms); virObjectUnref(doms);
return NULL; return NULL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册