Exemple #1
0
 public void Dispose()
 {
     NativeJob.CloseHandle(_hJob);
     foreach (Process process in _processes)
     {
         process.Dispose();
     }
     GC.SuppressFinalize(this);
     _hJob = IntPtr.Zero;
 }
Exemple #2
0
 protected virtual void Dispose(bool disposing)
 {
     if (!Disposed)
     {
         if (disposing)
         {
             foreach (Process process in _processes)
             {
                 process.Dispose();
             }
         }
         NativeJob.CloseHandle(_hJob);
         Disposed = true;
     }
 }
Exemple #3
0
        public void Dispose(bool disposing)
        {
            if (_hJob == IntPtr.Zero)
            {
                return;
            }

            if (disposing)
            {
                ReleaseManaged();
                GC.SuppressFinalize(this);
            }

            NativeJob.CloseHandle(_hJob);
            _hJob = IntPtr.Zero;
        }
Exemple #4
0
        protected virtual void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }

            if (disposing)
            {
                foreach (var process in _processes)
                {
                    process.Dispose();
                }
            }
            NativeJob.CloseHandle(_hJob);
            _disposed = true;
        }
Exemple #5
0
 protected virtual void Dispose(bool disposing)
 {
     if (_disposed)
     {
         return;
     }
     if (disposing)
     {
         foreach (var process in _processes)
         {
             process.Dispose();
         }
         _processes = null;
     }
     NativeJob.CloseHandle(_hJob);
     GC.RemoveMemoryPressure(_sizeInByte);
     _disposed = true;
 }
Exemple #6
0
        private bool disposedValue = false; // To detect redundant calls

        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    foreach (var process in _processes)
                    {
                        process.Dispose();
                    }
                }

                // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below.
                // TODO: set large fields to null.

                NativeJob.CloseHandle(_hJob);
                disposedValue = true;
            }
        }
        private void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }
            if (disposing)
            {
                foreach (Process p in _processes)
                {
                    p.Dispose();
                }
                _processes = null;
            }
            NativeJob.CloseHandle(_hJob);
            if (_size > 0)
            {
                GC.RemoveMemoryPressure(_size);

                _disposed = true;
            }
        }
Exemple #8
0
        protected virtual void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }
            if (disposing)
            {
                foreach (var proc in _processes)
                {
                    proc.Dispose();
                }
            }
            NativeJob.CloseHandle(_hJob);

            if (_sizeInByte > 0)
            {
                GC.RemoveMemoryPressure(_sizeInByte);
            }
            Console.WriteLine("Job was released");

            _disposed = true;
        }
Exemple #9
0
 private void Close()
 {
     NativeJob.CloseHandle(_hJob);
     _hJob = IntPtr.Zero;
 }
Exemple #10
0
 private void FreeResource()
 {
     NativeJob.CloseHandle(_hJob);
     _hJob = IntPtr.Zero;
 }