If I redirect StandardOutput
/StandardError
when creating a Process
object, should I dispose the StreamReaders
when I no longer need the Process
object? Using reflector I see that Process.Dispose()
does not do this for me (unless I'm missing something).
Yes the process object disposes of its own readers and their underlying streams. Redirected output retrieves a reader instance but the underlying stream is still managed by the processinfo which gets disposed automatically so no, you don't need to dispose of the reader.
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