The documentation says something that concerns me: 
http://libvirt.org/html/libvirt-libvirt.html#virConnectClose 

      "It is possible for the last virConnectClose to return a positive value if some 
       other object still has a temporary reference to the connection,   but the 
       application should not try to further use a connection after the 
       virConnectClose that matches the initial open."



The application I am working on requires that I know when the last thread using this connection goes away, so I can properly cleanup some overhead.  If I can't trust the return value of this call, how will I know that the connection is indeed torn down?  

Under what circumstances will the virConnectClose behave this way?

Thanks,

BTW, I am using 0.8.2