Finding undisposed objects

If you aren’t familiar with implementing the Dispose/Finalize pattern to clean up resources, stop and read this first. It is really important to get the implementation of the pattern right, or you’ll run into a performance problem at best, or risk leaking and running out of resources at worst. Assuming that you’ve implemented the pattern correctly for your types, how do you guarantee that Dispose is called on all finalizable types in your application? Sure, you have finalizers, but depending on them for cleanup is bad because 1. There is a definite cost to finalization. An object for which a … Continue reading Finding undisposed objects