提交 3d279e23 编写于 作者: M Martin Kletzander

Reference state when using it as opaque

There should be one more reference because it is being kept in the list
of callbacks as an opaque.  We also unref it properly using
virObjectFreeCallback.
Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
上级 1827f2ac
......@@ -870,12 +870,16 @@ virObjectEventStateRegisterID(virConnectPtr conn,
(state->timer = virEventAddTimeout(-1,
virObjectEventTimer,
state,
NULL)) < 0) {
virObjectFreeCallback)) < 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
_("could not initialize domain event timer"));
goto cleanup;
}
/* event loop has one reference, but we need one more for the
* timer's opaque argument */
virObjectRef(state);
ret = virObjectEventCallbackListAddID(conn, state->callbacks,
key, filter, filter_opaque,
klass, eventID,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册