The StreamWriter
is not guaranteed to be disposed when the application closes. Sometimes it will, but in some situations that's not possible.
There is no memory leak, as it uses managed memory. The entire heap is removed when the application closes.
It's not a resource leak either, as the open file handles will be closed when the application is shut down.
However, the StreamWriter
has a buffer that is not flushed if it's not disposed. That means that the last things that you wrote using the writer may be missing from the file.