private void dispose() { if (_scenes != null) { foreach (KeyValuePair <SceneType, Scene> kv in _scenes) { if (kv.Value != null) { kv.Value.Dispose(); } } } if (_player != null) { _player.Dispose(); } if (_prevMap != null) { _prevMap.Dispose(); } ResourceManager.Release(); if (_audioInput != null) { _audioInput.Disposed += (s, e) => { _disposed = true; }; _audioInput.CaptureStopped += (s, e) => { _audioInput.Dispose(); }; _audioInput.StopCapture(); } }
void Form1_FormClosing(object sender, FormClosingEventArgs e) { _input.Dispose(); }