Hi,
since Nim 2 brought ARC/ORC it is tempting to stop using try-finally for disposing resources. Because now =destroy will be called automatically when reference count drops to 0.
But some examples in stdlib documentation eg. std/httpclient still use try-finally. When I looked into the sources of stdlib I was unable to find =destroy for Socket and for SocketHandle. So does it mean that try-finally is still necessary?
Thanks
It's worth documenting part of the stdlib that have their resources freed with a =destroy hook since it's currently the exception, not the rule. I wouldn't mind contributing a little bit to this, but I suspect it might conflict with existing try/finally uses if there are new =destroy hooks added.
@Araq Is there expected to be problems for most =destroy hooks if they're called multiple times? I'm assuming there are a lot of resources that if a =destroy hook was added to them, that existing code with try/finally might end up trying to free resources twice.