My logging tool opens a SerialPort and a FileStream. After closing the form and reopening it, I get an access denied error for COM3, or a message that the file is being used by another process, until I restart the application. I thought the garbage collector cleans up objects that are no longer referenced.
What is IDisposable for when the runtime already has a garbage collector, when should my own classes implement it, and is the full pattern with Dispose(bool) and a finalizer always required?




