B
Brad Wood
I have a test routine where I want to call
new XmlTextReader( new StringReader( xmlString ) )
repeatedly. Structuring the code so that I call Close (which calls
Dispose) on the StringReader makes the code much fatter.
Is failing to call Close on each instance here really a bad thing? Is
it a matter of improper protocol?
When I run tests creating gobs of StringReaders and letting them go out
of scope w/o calling Close, there don't seem to be any resulting memory
leaks (just by looking at the windows task manager memory). I presume
this is because there really isn't any unmanaged resources referenced (I
can't seem to find any while looking at StringReader and parent
TextReader in Reflector).
new XmlTextReader( new StringReader( xmlString ) )
repeatedly. Structuring the code so that I call Close (which calls
Dispose) on the StringReader makes the code much fatter.
Is failing to call Close on each instance here really a bad thing? Is
it a matter of improper protocol?
When I run tests creating gobs of StringReaders and letting them go out
of scope w/o calling Close, there don't seem to be any resulting memory
leaks (just by looking at the windows task manager memory). I presume
this is because there really isn't any unmanaged resources referenced (I
can't seem to find any while looking at StringReader and parent
TextReader in Reflector).