You need to sign in or sign up before continuing.
提交 a16cd9a6 编写于 作者: N Nikolay Shirokovskiy 提交者: Daniel P. Berrange

virConnectCloseCallbackData: fix connection object refcount

We have reference to connection object in virConnectCloseCallbackData
object thus we have to refcount it. Obviously we have problems
in dispose and call functions. Let's fix it.
Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
上级 24dbb69f
...@@ -180,6 +180,7 @@ virConnectCloseCallbackDataDispose(void *obj) ...@@ -180,6 +180,7 @@ virConnectCloseCallbackDataDispose(void *obj)
if (cb->freeCallback) if (cb->freeCallback)
cb->freeCallback(cb->opaque); cb->freeCallback(cb->opaque);
virObjectUnref(cb->conn);
virObjectUnlock(cb); virObjectUnlock(cb);
} }
...@@ -226,6 +227,7 @@ void virConnectCloseCallbackDataUnregister(virConnectCloseCallbackDataPtr close, ...@@ -226,6 +227,7 @@ void virConnectCloseCallbackDataUnregister(virConnectCloseCallbackDataPtr close,
close->freeCallback(close->opaque); close->freeCallback(close->opaque);
close->freeCallback = NULL; close->freeCallback = NULL;
virObjectUnref(close->conn); virObjectUnref(close->conn);
close->conn = NULL;
cleanup: cleanup:
...@@ -248,6 +250,8 @@ void virConnectCloseCallbackDataCall(virConnectCloseCallbackDataPtr close, ...@@ -248,6 +250,8 @@ void virConnectCloseCallbackDataCall(virConnectCloseCallbackDataPtr close,
close->freeCallback(close->opaque); close->freeCallback(close->opaque);
close->callback = NULL; close->callback = NULL;
close->freeCallback = NULL; close->freeCallback = NULL;
virObjectUnref(close->conn);
close->conn = NULL;
exit: exit:
virObjectUnlock(close); virObjectUnlock(close);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册