Is there a way to keep track of undisposed objects while debugging? For example after breakpoint is hit, I'd look to view what developers have forgotten to clean up.
Not directly.
However, you can add finalizers to your Disposable classes, and have the finalizers call a method attributed with [Conditional("DEBUG"]
that logs/throws/notifies you when they are hit. This allows you to track when a Dispose() method was not called on an object at debug time, but at deployment, will just get finalized as normal.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With