mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 05:17:59 +03:00
Use virNWFilterBindingObjEndAPI() more
Instead of explicit virObjectUnlock(obj) + virObjectUnref(obj) combo the virNWFilterBindingObjEndAPI() can be used. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
parent
c6edab9d5d
commit
375fb7d576
@ -114,11 +114,8 @@ virNWFilterBindingObjListFindByPortDev(virNWFilterBindingObjList *bindings,
|
||||
obj = virNWFilterBindingObjListFindByPortDevLocked(bindings, name);
|
||||
virObjectRWUnlock(bindings);
|
||||
|
||||
if (obj && virNWFilterBindingObjGetRemoving(obj)) {
|
||||
virObjectUnlock(obj);
|
||||
virObjectUnref(obj);
|
||||
obj = NULL;
|
||||
}
|
||||
if (obj && virNWFilterBindingObjGetRemoving(obj))
|
||||
virNWFilterBindingObjEndAPI(&obj);
|
||||
|
||||
return obj;
|
||||
}
|
||||
@ -407,8 +404,7 @@ virNWFilterBindingObjListFilter(virNWFilterBindingObj ***list,
|
||||
*/
|
||||
if (virNWFilterBindingObjGetRemoving(binding) ||
|
||||
(filter && !filter(conn, def))) {
|
||||
virObjectUnlock(binding);
|
||||
virObjectUnref(binding);
|
||||
virNWFilterBindingObjEndAPI(&binding);
|
||||
VIR_DELETE_ELEMENT(*list, i, *nbindings);
|
||||
continue;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user