/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// </summary> /// <filterpriority>2</filterpriority> public void Dispose() { foreach (KeyValuePair <KeyCombination, List <KeyHandler> > pair in _mappings) { pair.Value.Clear(); } _mappings.Clear(); SystemEventDispatcher.Instance.RemoveEventListener(KeyboardEvent.KEY_DOWN, Instance.OnKeyEvent); SystemEventDispatcher.Instance.RemoveEventListener(KeyboardEvent.KEY_UP, Instance.OnKeyEvent); _instance = null; }
/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// </summary> /// <filterpriority>2</filterpriority> public void Dispose() { foreach (KeyValuePair<KeyCombination, List<KeyHandler>> pair in _mappings) { pair.Value.Clear(); } _mappings.Clear(); SystemEventDispatcher.Instance.RemoveEventListener(KeyboardEvent.KEY_DOWN, Instance.OnKeyEvent); SystemEventDispatcher.Instance.RemoveEventListener(KeyboardEvent.KEY_UP, Instance.OnKeyEvent); _instance = null; }