From 7dbcdce64573d3bfd94593c6d8a2b5a0aec40e76 Mon Sep 17 00:00:00 2001 From: Jordan Dominion Date: Wed, 12 Jul 2023 23:44:30 -0400 Subject: [PATCH] Add usings for redirected process std handles --- src/Tgstation.Server.Host/System/ProcessExecutor.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Tgstation.Server.Host/System/ProcessExecutor.cs b/src/Tgstation.Server.Host/System/ProcessExecutor.cs index 0512cb9a46..8c9f98bd65 100644 --- a/src/Tgstation.Server.Host/System/ProcessExecutor.cs +++ b/src/Tgstation.Server.Host/System/ProcessExecutor.cs @@ -195,8 +195,9 @@ namespace Tgstation.Server.Host.System var pid = handle.Id; logger.LogTrace("Starting read for PID {pid}...", pid); - var stdOutHandle = handle.StandardOutput; - var stdErrHandle = handle.StandardError; + // once we obtain these handles we're responsible for them + using var stdOutHandle = handle.StandardOutput; + using var stdErrHandle = handle.StandardError; Task outputReadTask = null, errorReadTask = null; bool outputOpen = true, errorOpen = true; async Task GetNextLine()