Let's say I have an update loop from a game and every loop I output a new list from a class function and assign it to 'myList'. What happens to the list from previous update functions? Do I have to worry about it?
//someClass
List<T> GetList()
{
List<T> l = new List<T>(); // I create a new list here
//populate the list.....
return l;
}
------------------
void Update()
{
//game update loop
List<T> myList = someClass.GetList();
//what happens to the previous instance of list created?
}