Instead of explicit virObjectUnlock(obj) + virObjectUnref(obj)
combo the virInterfaceObjEndAPI() can be used.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/conf/virinterfaceobj.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/conf/virinterfaceobj.c b/src/conf/virinterfaceobj.c
index fa7a21c054..c5dfa6c7f5 100644
--- a/src/conf/virinterfaceobj.c
+++ b/src/conf/virinterfaceobj.c
@@ -462,8 +462,7 @@ virInterfaceObjListRemove(virInterfaceObjList *interfaces,
virObjectRWLockWrite(interfaces);
virObjectLock(obj);
virHashRemoveEntry(interfaces->objsName, obj->def->name);
- virObjectUnlock(obj);
- virObjectUnref(obj);
+ virInterfaceObjEndAPI(&obj);
virObjectRWUnlock(interfaces);
}
--
2.32.0