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: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
{
virObjectLock(close);
- if (!close->callback)
+ if (!close->conn)
goto exit;
VIR_DEBUG("Triggering connection close callback %p reason=%d, opaque=%p",
if (close->freeCallback)
close->freeCallback(close->opaque);
- close->callback = NULL;
close->freeCallback = NULL;
virObjectUnref(close->conn);
close->conn = NULL;