mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-11-01 13:13:21 -07:00
fix<Command>: fix crash when cancel a process that already
This commit is contained in:
parent
17e9ce2a2f
commit
e7a7c0518e
1 changed files with 7 additions and 8 deletions
|
@ -79,9 +79,9 @@ namespace SourceGit.Commands {
|
||||||
proc.CancelErrorRead();
|
proc.CancelErrorRead();
|
||||||
proc.CancelOutputRead();
|
proc.CancelOutputRead();
|
||||||
#if NET48
|
#if NET48
|
||||||
proc.Kill();
|
if (!proc.HasExited) proc.Kill();
|
||||||
#else
|
#else
|
||||||
proc.Kill(true);
|
if (!proc.HasExited) proc.Kill(true);
|
||||||
#endif
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -95,17 +95,16 @@ namespace SourceGit.Commands {
|
||||||
proc.CancelErrorRead();
|
proc.CancelErrorRead();
|
||||||
proc.CancelOutputRead();
|
proc.CancelOutputRead();
|
||||||
#if NET48
|
#if NET48
|
||||||
proc.Kill();
|
if (!proc.HasExited) proc.Kill();
|
||||||
#else
|
#else
|
||||||
proc.Kill(true);
|
if (!proc.HasExited) proc.Kill(true);
|
||||||
#endif
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.Data == null) return;
|
if (string.IsNullOrEmpty(e.Data)) return;
|
||||||
if (TraitErrorAsOutput) OnReadline(e.Data);
|
if (TraitErrorAsOutput) OnReadline(e.Data);
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(e.Data)) return;
|
|
||||||
if (progressFilter.IsMatch(e.Data)) return;
|
if (progressFilter.IsMatch(e.Data)) return;
|
||||||
if (e.Data.StartsWith("remote: Counting objects:", StringComparison.Ordinal)) return;
|
if (e.Data.StartsWith("remote: Counting objects:", StringComparison.Ordinal)) return;
|
||||||
errs.Add(e.Data);
|
errs.Add(e.Data);
|
||||||
|
|
Loading…
Reference in a new issue