mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-23 03:42:19 +00:00
virNetSocketRemoveIOCallback: Be explicit about unref
When going through the code I've notice that virNetSocketAddIOCallback() increases the reference counter of @socket. However, its counter part RemoveIOCallback does not. It took me a while to realize this disproportion. The AddIOCallback registers our own callback which eventually calls the desired callback and then unref the @sock. Yeah, a bit complicated but it works. So, lets note this hard learned fact in a comment in RemoveIOCallback(). Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
058d18bdbc
commit
899e49a2e6
@ -1993,6 +1993,7 @@ void virNetSocketRemoveIOCallback(virNetSocketPtr sock)
|
||||
}
|
||||
|
||||
virEventRemoveHandle(sock->watch);
|
||||
/* Don't unref @sock, it's done via eventloop callback. */
|
||||
|
||||
virObjectUnlock(sock);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user