protected virtual void Dispose(bool disposing) { if (disposed) { return; } if (disposing) { UIRUtility.Destroy(atlas); atlas = null; if (m_Allocator != null) { m_Allocator.Dispose(); m_Allocator = null; } if (m_Blitter != null) { m_Blitter.Dispose(); m_Blitter = null; } } else { UnityEngine.UIElements.DisposeHelper.NotifyMissingDispose(this); } disposed = true; }
protected virtual void Dispose(bool disposing) { if (disposed) { return; } if (disposing) { if (atlas != null) { UIRUtility.Destroy(atlas); atlas = null; } if (m_Allocator != null) { // m_Allocator.Dispose(); TODO once we pool content m_Allocator = null; } if (m_Blitter != null) { m_Blitter.Dispose(); m_Blitter = null; } if (textureId != TextureId.invalid) { TextureRegistry.instance.Release(textureId); textureId = TextureId.invalid; } } else { UnityEngine.UIElements.DisposeHelper.NotifyMissingDispose(this); } disposed = true; }