コード例 #1
0
        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;
        }