public void Dispose() { Disposing = true; frameEndActions.Clear(); Sound.StopAudio(); Sound.StopVideo(); // Dispose newer actors first, and the world actor last foreach (var a in actors.Reverse()) { a.Dispose(); } // Actor disposals are done in a FrameEndTask while (frameEndActions.Count != 0) { frameEndActions.Dequeue()(this); } }