void OnDestroy() { if (__uniqueInstance != this) //Destroying an illegal duplicate { return; } //Call static cleaners first GATPlayer.CleanUpStatics(); if (__allocator != null) { __allocator.Dispose(); __allocator = null; } DefaultPlayer = null; __uniqueInstance = null; onMainThreadResumed = null; //System.GC.Collect(); }