public void IsDisposed_ShouldReturnTrue_When_AlreadyDisposed()
        {
            var glCalculatorHelper = new GlCalculatorHelper();

            glCalculatorHelper.Dispose();

            Assert.True(glCalculatorHelper.isDisposed);
        }
예제 #2
0
 protected virtual void OnDestroy()
 {
     Stop();
     if (graph != null)
     {
         graph.Dispose();
         graph = null;
     }
     if (gpuHelper != null)
     {
         gpuHelper.Dispose();
         gpuHelper = null;
     }
 }
예제 #3
0
        /// <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;
        }