提交 0278c77d 编写于 作者: P Peter Krempa

util: object: Reset pointer when unrefing object in virObjectAutoUnref

The helper function is used by the VIR_AUTOUNREF macro. Prior art is to
clear the pointer even if the variable goes out of scope.
Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 2ee00d59
......@@ -372,6 +372,7 @@ virObjectAutoUnref(void *objptr)
{
virObjectPtr *obj = objptr;
virObjectUnref(*obj);
*obj = NULL;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册