private void Cleanup(bool requested)
        {
            // TODO: Read and log messages written to STDERR, for cases where, for example, the VM exits with errors before the stitch script is executed
            //var contents = _process.StandardError.ReadToEnd();
            if (_process != null && !_process.HasExited)
            {
                _process.CancelErrorRead();
                _process.CancelOutputRead();
                _process.Kill();
                _process = null;
            }

            _channel.Dispose();
            _channel = null;

            _observer.StitchStateChanged(_stitchInstance.Id, false, requested);
        }
Esempio n. 2
0
 private void Cleanup(bool requested)
 {
     // TODO: Read and log messages written to STDERR, for cases where, for example, the VM exits with errors before the stitch script is executed
     //var contents = _process.StandardError.ReadToEnd();
     if (_process != null && !_process.HasExited)
     {
         _process.CancelErrorRead();
         _process.CancelOutputRead();
         _process.Kill();
         _process = null;
     }
     if (_channel != null)
     {
         _channel.Dispose();
         _channel = null;
     }
     StitchContext.RaiseProcessEvent(false, requested);
 }