提交 178ac3d1 编写于 作者: J John Ferlan

network: Move virObjectRef during AssignDef processing

Move the virObjectRef in virNetworkObjAssignDefLocked to after
the virHashAddEntry to make it "clearer" why the @ref is being
incremented. Upon return from the ObjNew we will have 1 ref on
the object already, adding it to the hash table requires the
increment.
Signed-off-by: NJohn Ferlan <jferlan@redhat.com>
上级 7beef708
......@@ -577,10 +577,10 @@ virNetworkObjAssignDefLocked(virNetworkObjListPtr nets,
virUUIDFormat(def->uuid, uuidstr);
if (virHashAddEntry(nets->objs, uuidstr, obj) < 0)
goto cleanup;
virObjectRef(obj);
obj->def = def;
obj->persistent = !(flags & VIR_NETWORK_OBJ_LIST_ADD_LIVE);
virObjectRef(obj);
}
ret = obj;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册