void OnDestroy() { Debug.Log("OnDestroy UTH called"); foreach (var thread in registeredThreads) { Debug.Log("Disposing a thread..."); thread.Dispose(); } if (dispatcher != null) { dispatcher.Dispose(); } dispatcher = null; if (taskDistributor != null) { taskDistributor.Dispose(); } taskDistributor = null; if (instance == this) { instance = null; } }
void OnDestroy() { foreach (var thread in registeredThreads) { thread.Dispose(); } if (dispatcher != null) { dispatcher.Dispose(); } dispatcher = null; if (taskDistributor != null) { taskDistributor.Dispose(); } taskDistributor = null; }
void OnDestroy() { foreach (var thread in registeredThreads) { thread.Dispose(); } if (dispatcher != null) { dispatcher.Dispose(); } dispatcher = null; if (taskDistributor != null) { taskDistributor.Dispose(); } taskDistributor = null; //maybe must be fixed! :P // if (instance == this) // instance = null; }