Esempio n. 1
0
        void OnDestroy()
        {
            foreach (var thread in registeredThreads)
            {
                thread.Dispose();
            }

            if (CurrentDispatcher != null)
            {
                CurrentDispatcher.Dispose();
            }
            CurrentDispatcher = null;

            if (CurrentTaskDistributor != null)
            {
                CurrentTaskDistributor.Dispose();
            }
            CurrentTaskDistributor = null;
        }
Esempio n. 2
0
        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();
        }