Пример #1
0
 /// <summary>
 /// Dispose of the process group
 /// </summary>
 public void Dispose()
 {
     if (JobHandle != null)
     {
         JobHandle.Dispose();
         JobHandle = null;
     }
 }
Пример #2
0
        public RestrictedProcessHandle(string processPath, string commandline)
        {
            myJobHandle = new JobHandle();

            try
            {
                var cli = $"\"{processPath.Replace("\"", "")}\" {commandline}";
                myProcessHandle = new ProcessHandle(cli, myJobHandle);
            }
            catch
            {
                myJobHandle.Dispose();
                throw;
            }
        }
Пример #3
0
        protected virtual void Dispose(bool disposing)
        {
            if (_isDisposed)
            {
                return;
            }

            if (disposing)
            {
                //Free managed objects here
                _jobHandle?.Dispose();
                _jobHandle = null;
            }
            //Free unmanaged objects here
            _isDisposed = true;
        }
Пример #4
0
 public void Dispose()
 {
     myJobHandle.Dispose();
     myProcessHandle.Dispose();
 }