public static void UpdateActiveList() { for (int i = 0; i < activeList.Count; /* this space intentinally left blank */) { Twitch <T> twitch = activeList[i]; //PV: this is a bug. The code should be: if ( twitch!=null && twitch.Update()==false ) // if (twitch == null || twitch.Update() == false) { // The twitch has indicated that it is no longer active. // Move it to the free list. activeList.RemoveAt(i); twitch.Clean(); freeList.Add(twitch); } else { // Only increment the index if we didn't delete the current twitch. i++; } } } // end of UpdateList()