void Destructor() { if (m_StaticIndex >= 0) { RenderChainStaticIndexAllocator.FreeIndex(m_StaticIndex); } m_StaticIndex = -1; UIRUtility.Destroy(m_DefaultMat); UIRUtility.Destroy(m_DefaultWorldSpaceMat); m_DefaultMat = m_DefaultWorldSpaceMat = null; Font.textureRebuilt -= OnFontReset; painter?.Dispose(); m_TextUpdatePainter?.Dispose(); atlasManager?.Dispose(); vectorImageManager?.Dispose(); shaderInfoAllocator.Dispose(); device?.Dispose(); painter = null; m_TextUpdatePainter = null; atlasManager = null; shaderInfoAllocator = new UIRVEShaderInfoAllocator(); device = null; m_ActiveRenderNodes = 0; m_RenderNodesData.Clear(); }
protected void Dispose(bool disposing) { if (disposed) { return; } if (disposing) { Font.textureRebuilt -= OnFontReset; painter?.Dispose(); m_TextUpdatePainter?.Dispose(); atlasManager?.Dispose(); device?.Dispose(); painter = null; m_TextUpdatePainter = null; atlasManager = null; device = null; } else { DisposeHelper.NotifyMissingDispose(this); } disposed = true; }
void Destructor() { Font.textureRebuilt -= OnFontReset; painter?.Dispose(); m_TextUpdatePainter?.Dispose(); atlasManager?.Dispose(); vectorImageManager?.Dispose(); shaderInfoAllocator.Dispose(); device?.Dispose(); painter = null; m_TextUpdatePainter = null; atlasManager = null; shaderInfoAllocator = new UIRVEShaderInfoAllocator(); device = null; }