Science, asked by Jain12, 1 year ago

Does streamreader dispose automatically after out of scope

Answers

Answered by KGB
0
It's safe to ignore it in this case. Or you can just create the stream in the constructor call to StreamReader. The warning looks bogus to me, given that the docs for IDisposable.Dispose explicitly state: "If an object's Dispose method is called more than once, the object must ignore all calls after the first one. The object must not throw an exception if its Dispose method is called multiple times."
Answered by XlXPXlX
1

Nope it doesn't

You see the thing here is that I don't understand so I can't tell whether it dispose or not.

Hope it doesn't help

Similar questions