From e7147ffc26dbd65c3aae5af7e6b0c6855f6204d9 Mon Sep 17 00:00:00 2001 From: Kazuhiro Fujieda Date: Sat, 27 Jan 2018 17:41:19 +0900 Subject: [PATCH] =?utf8?q?=E7=95=B0=E5=B8=B8=E7=B5=82=E4=BA=86=E6=99=82?= =?utf8?q?=E3=81=AB=E8=A8=AD=E5=AE=9A=E3=82=92=E4=BF=9D=E5=AD=98=E3=81=97?= =?utf8?q?=E3=81=AA=E3=81=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- KancolleSniffer/MainForm.cs | 14 ++++++++++---- KancolleSniffer/ProxyManager.cs | 3 ++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/KancolleSniffer/MainForm.cs b/KancolleSniffer/MainForm.cs index ed6051e..f9365a2 100644 --- a/KancolleSniffer/MainForm.cs +++ b/KancolleSniffer/MainForm.cs @@ -160,28 +160,34 @@ namespace KancolleSniffer if (_errorDialog.ShowDialog(this, "艦これに仕様変更があったか、受信内容が壊れています。", _errorLog.GenerateErrorLog(url, request, response, e.ToString())) == DialogResult.Abort) - Application.Exit(); + Exit(); } catch (LogIOException e) { // ReSharper disable once PossibleNullReferenceException if (_errorDialog.ShowDialog(this, e.Message, e.InnerException.ToString()) == DialogResult.Abort) - Application.Exit(); + Exit(); } catch (BattleResultError) { if (_errorDialog.ShowDialog(this, "戦闘結果の計算に誤りがあります。", _errorLog.GenerateBattleErrorLog()) == DialogResult.Abort) - Application.Exit(); + Exit(); } catch (Exception e) { if (_errorDialog.ShowDialog(this, "エラーが発生しました。", _errorLog.GenerateErrorLog(url, request, response, e.ToString())) == DialogResult.Abort) - Application.Exit(); + Exit(); } } + private void Exit() + { + _proxyManager.Shutdown(); + Environment.Exit(1); + } + private void WriteDebugLog(string url, string request, string response) { if (_debugLogFile != null) diff --git a/KancolleSniffer/ProxyManager.cs b/KancolleSniffer/ProxyManager.cs index 275329f..283564d 100644 --- a/KancolleSniffer/ProxyManager.cs +++ b/KancolleSniffer/ProxyManager.cs @@ -155,7 +155,8 @@ namespace KancolleSniffer MessageBoxIcon.Error)) { case DialogResult.Abort: - Application.Exit(); + Shutdown(); + Environment.Exit(1); break; case DialogResult.Ignore: return; -- 2.11.0