What's Wrong with this code - #4
Here's another one for you. This segment of code gets the list of all responses to be sent and sends them.
public void TransmitResponse(ArrayList responses,
StreamWriter streamWriter)
{
foreach (DataResponse response in responses)
{
NetworkResponse networkResponse = response.GetNetwork();
networkResponse.Send(streamWriter);
}
GC.Collect(); // clean up temporary objects
}
Three questions:
1) What's wrong with this code?
B) Why?
III) What should you do instead?