public override void Update(GameTime gameTime) { m_soundManager.Update(gameTime.ElapsedGameTime); UpdateView(gameTime); using (var handle = m_safeParticlesCollection.SafeRead()) { for (int i = 0; i < handle.Items.Count; i++) { if (handle.Items[i].IsGarbage) { m_safeParticlesCollection.RemoveAt(i); } else { handle.Items[i].Update(gameTime); } } } using (var handle = m_safeDrawableGameComponents.SafeRead()) { MyDrawableGameComponent[] copy = m_safeDrawableGameComponents.ToArray(); for (int i = copy.Length - 1; i >= 0; i--) { if (!copy[i].IsGarbage) { copy[i].Update(gameTime); } else { m_safeDrawableGameComponents.RemoveAt(i); } } } }