public void IsDisposed_ShouldReturnTrue_When_AlreadyDisposed() { var glCalculatorHelper = new GlCalculatorHelper(); glCalculatorHelper.Dispose(); Assert.True(glCalculatorHelper.isDisposed); }
protected virtual void OnDestroy() { Stop(); if (graph != null) { graph.Dispose(); graph = null; } if (gpuHelper != null) { gpuHelper.Dispose(); gpuHelper = null; } }
/// <summary> /// Dispose GPU resources. /// </summary> /// <remarks> /// This has to be called before the application exits. /// Otherwise, UnityEditor can freeze. /// </remarks> public static void Shutdown() { if (GpuResources != null) { GpuResources.Dispose(); GpuResources = null; } if (GlCalculatorHelper != null) { GlCalculatorHelper.Dispose(); GlCalculatorHelper = null; } IsInitialized = false; }