3 ms·
Actually, that's what the using statement and IDisposable is for (which is just a try/finally in disguise). Use Dispose to clean up, which has to be invoked exp
by ygra 13y ago
Actually, that's what the using statement and IDisposable is for (which is just a try/finally in disguise). Use Dispose to clean up, which has to be invoked explicitly or via using. And call Dispose in the finalizer as well to safeguard against accidental resource leaks. Since Dispose is supposed to be idempotent that won't cause trouble usually.
Admittedly, I didn't even read the question and just thought the answer was quite interesting, regardless of the context.