I have a class in C # where I want to close some communication ports properly when my class is deleted. However, the finalizer is never called when I exit the program. Why is this? Am I doing something wrong?
I call the utility manually, which goes through and closes all messages. This does not work.
Here is the finalizer I'm using:
~Power()
{
Dispose(false);
}
source
share