3 ms·
Sure, there are other strategies for handling the problem. But many have latent bugs, which is mostly what this article is pointing out. In your case 2, unless
by StillBored 11y ago
Sure, there are other strategies for handling the problem. But many have latent bugs, which is mostly what this article is pointing out.
In your case 2, unless you try to force the finalizer to run (he has a collect/waitforpendingfinalizers sequence in one of his examples) this potentially leaves the resource consumed for an indeterminate amount of time.
Its also not clear to me that the *Handle routines guarantee correct behavior with processes running outside of the CLR. I just looked at the docs and it reenforced my understanding that they seem to be strictly designed to protect .net applications from shooting themselves in the foot. I'm not a .net/CLR expert so take that for what its worth.
- deleted 11y ago[deleted]