I have the following code:
MemoryStream foo(){
MemoryStream ms = new MemoryStream();
// write stuff to ms
return ms;
}
void bar(){
MemoryStream ms2 = foo();
// do stuff with ms2
return;
}
Is there any chance that the MemoryStream that I've allocated will somehow fail to be disposed of later?
I've got a peer review insisting that I manually close this, and I can't find the information to tell if he has a valid point or not.