In the code below, does not clearing or setting the local variable completed to null create the potential for a memory leak?
private Vector<Element> elements;
private void update()
{
Vector<Element> completed = new Vector<Element>();
for( Element e : elements )
{
if( e.isComplete() )
{
completed.add( e );
} else {
e.update();
}
}
elements.removeAll( complete );
}
Should I add complete.clear() before the update() method exits?
The elements Vector is an instance variable on a class that is populated with Element objects elsewhere in the program.