void OnDestroy() { foreach (var thread in registeredThreads) { thread.Dispose(); } if (CurrentDispatcher != null) { CurrentDispatcher.Dispose(); } CurrentDispatcher = null; if (CurrentTaskDistributor != null) { CurrentTaskDistributor.Dispose(); } CurrentTaskDistributor = null; }
protected override void OnDestroy() { foreach (var thread in _registeredThreads) { thread.Dispose(); } if (CurrentDispatcher != null) { CurrentDispatcher.Dispose(); } CurrentDispatcher = null; if (CurrentTaskDistributor != null) { CurrentTaskDistributor.Dispose(); } CurrentTaskDistributor = null; base.OnDestroy(); }