提交 42b0f751 编写于 作者: N Nikolay Shirokovskiy 提交者: Daniel P. Berrange

close callback: make unregister clean after connect close event

If connect close is fired then following unregister will fail
as we set callback to NULL and thus callback equality checking
will fail.

Callback is set to NULL to make it fired only one time probabaly.
Instead lets use connection equality to NULL to check if callback
is already fired.
Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
上级 a16cd9a6
......@@ -239,7 +239,7 @@ void virConnectCloseCallbackDataCall(virConnectCloseCallbackDataPtr close,
{
virObjectLock(close);
if (!close->callback)
if (!close->conn)
goto exit;
VIR_DEBUG("Triggering connection close callback %p reason=%d, opaque=%p",
......@@ -248,7 +248,6 @@ void virConnectCloseCallbackDataCall(virConnectCloseCallbackDataPtr close,
if (close->freeCallback)
close->freeCallback(close->opaque);
close->callback = NULL;
close->freeCallback = NULL;
virObjectUnref(close->conn);
close->conn = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册