I have slight memory leak in my app and I was wondering what is best practise when when I am finished processing a FileStream and Streamreader.
here is my code:
using (var stream = File.Open(e.FullPath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
using (var sr = new StreamReader(stream))
{
//do what I need with the file
sr.Close();
stream.Close();
}
Should I be called Dispose on the stream object and StreamReader Object instead? Or is closing both here good enough?
Thanks