/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// </summary> public void Dispose() { // If this component was disposed. Remove the static reference to avoid unnecessary memory withholding if (CurrentFocus == this) { CurrentFocus = null; } }
/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// </summary> public override void Dispose() { FocusBehavior focusBehavior = this.entity.FindComponent <FocusBehavior>(); if (focusBehavior != null) { if (FocusBehavior.CurrentFocus == focusBehavior) { FocusBehavior.CurrentFocus = null; } } base.Dispose(); }