Possible Duplicate:
Loops and Garbage Collection
foreach (ObjectTypeA typea in ObjectTypeACollection)
{
var objectTypeAProcessor= new objectTypeAProcessor();
objectTypeAProcessor.Process(typea);
}
I found the above similar code where a collection of objects was being processed at the BLL and the DAL processor was called.Will the above code lead to a memory leak / is it bad? Well a new instance is created each time right but does it get destroyed each time too? mmm...