public override void Cleanup() { var listeners = RequestClose?.GetInvocationList(); if (listeners?.Length > 0) { foreach (var listener in listeners) { RequestClose -= listener as EventHandler; } } RequestClose = null; base.Cleanup(); }
protected override void OnDispose() { var listeners = RequestClose?.GetInvocationList(); if (listeners?.Length > 0) { foreach (var listener in listeners) { RequestClose -= listener as EventHandler; } } RequestClose = null; base.OnDispose(); }