3 ms·
Erik's example of the using statement is a straw-man: you get exactly the same problems if you do this: using(var file = File.Open(path)) { _someField = fi
by radicalbyte 12y ago
Erik's example of the using statement is a straw-man: you get exactly the same problems if you do this:
using(var file = File.Open(path))
{
_someField = file;
}
..and then use _someField in another method.
It's not so much a problem with understanding closures, but of the limitations of IDisposable.