using statement is only useful under *very* limited circumstances. Far more
often the code allocating the resource is not the top-level process to whom the resource use is limited. Also, often the resource holding object is shared. using provides no method of handling shared ownership of a resource.
So according to what you say, modern GC languages have no way of handling shared resource problem (unlike, uh, C++, which has reference-counted RAII patterns at least)
Another problem is that .NET allows you to reference (not weak references, the real thing) IDisposable objects from non-IDisposable ones. So you may perfectly well be referencing a zombie object which has been disposed of, but not GC'ed.
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds