Пример #1
0
        private bool disposedValue = false; // To detect redundant calls

        /// <summary>
        /// Override this to dispose things in your child class
        /// </summary>
        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    GcHandle.Free();
                }

                disposedValue = true;
            }
        }
Пример #2
0
 protected virtual void Dispose(bool disposing)
 {
     if (!disposed)
     {
         if (disposing)
         {
             window.Close();
             EventCallback = null;
             swapchain.Framebuffer.Dispose();
             swapchain.Dispose();
             GcHandle.Free();
         }
         disposed = true;
     }
 }