public virtual void Dispose() { lock (EventListener.EventListenersLock) { if (EventListener.s_Listeners == null) { return; } if (this == EventListener.s_Listeners) { EventListener temp_20 = EventListener.s_Listeners; EventListener.s_Listeners = this.m_Next; EventListener.RemoveReferencesToListenerInEventSources(temp_20); } else { EventListener local_2 = EventListener.s_Listeners; EventListener local_3; while (true) { local_3 = local_2.m_Next; if (local_3 != null) { if (local_3 != this) { local_2 = local_3; } else { goto label_7; } } else { break; } } return; label_7: local_2.m_Next = local_3.m_Next; EventListener.RemoveReferencesToListenerInEventSources(local_3); } } }
public virtual void Dispose() { object eventListenersLock = EventListener.EventListenersLock; lock (eventListenersLock) { if (EventListener.s_Listeners != null) { if (this == EventListener.s_Listeners) { EventListener listenerToRemove = EventListener.s_Listeners; EventListener.s_Listeners = this.m_Next; EventListener.RemoveReferencesToListenerInEventSources(listenerToRemove); } else { EventListener eventListener = EventListener.s_Listeners; EventListener next; for (;;) { next = eventListener.m_Next; if (next == null) { break; } if (next == this) { goto Block_6; } eventListener = next; } return; Block_6: eventListener.m_Next = next.m_Next; EventListener.RemoveReferencesToListenerInEventSources(next); } } } }