From ac72184ac29ce3d4fa8bfb41cf64881855b10d95 Mon Sep 17 00:00:00 2001 From: Iwasa Kazmi Date: Sun, 11 Feb 2024 14:28:25 +0900 Subject: [PATCH] delete unused variables --- SerialPort/SerialConnection.cs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/SerialPort/SerialConnection.cs b/SerialPort/SerialConnection.cs index 05cafdb4..affbce5e 100644 --- a/SerialPort/SerialConnection.cs +++ b/SerialPort/SerialConnection.cs @@ -563,8 +563,6 @@ public ITerminalConnection EstablishConnection(IPoderosaMainWindow window, ITerm internal class SerialPortUtil { public static SerialTerminalConnection CreateNewSerialConnection(IPoderosaMainWindow window, SerialTerminalParam param, SerialTerminalSettings settings) { - bool successful = false; - FileStream strm = null; try { StringResource sr = SerialPortPlugin.Instance.Strings; //Debug.WriteLine("OPENING COM"+param.Port); @@ -598,7 +596,6 @@ public static SerialTerminalConnection CreateNewSerialConnection(IPoderosaMainWi timeouts.WriteTotalTimeoutConstant = 100; timeouts.WriteTotalTimeoutMultiplier = 100; Win32Serial.SetCommTimeouts(ptr, ref timeouts); - successful = true; SerialTerminalConnection r = new SerialTerminalConnection(param, settings, ptr); return r; } @@ -610,10 +607,6 @@ public static SerialTerminalConnection CreateNewSerialConnection(IPoderosaMainWi GUtil.Warning(Form.ActiveForm, ex.Message); //TODO 苦しい逃げ。IPoderosaFormを実装したベースクラスをCoreにでも持っていたほうがいいのか return null; } - finally { - if (!successful && strm != null) - strm.Close(); - } } public static bool FillDCB(IntPtr handle, ref Win32Serial.DCB dcb) { dcb.DCBlength = (uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(Win32Serial.DCB)); //sizeofくらいunsafeでなくても使わせてくれよ