From a4f024df69085ef692d151e42705c095eddb4587 Mon Sep 17 00:00:00 2001 From: ChsBuffer <33744752+chsbuffer@users.noreply.github.com> Date: Thu, 5 Nov 2020 15:04:54 +0800 Subject: [PATCH] refactor: clean temp config file when exit --- Netch/Forms/MainForm.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Netch/Forms/MainForm.cs b/Netch/Forms/MainForm.cs index 29707818..f6b0e5f8 100644 --- a/Netch/Forms/MainForm.cs +++ b/Netch/Forms/MainForm.cs @@ -283,8 +283,11 @@ namespace Netch.Forms Configuration.Save(); - if (File.Exists("data\\last.json")) - File.Delete("data\\last.json"); + foreach (var file in new[] {"data\\last.json", "data\\privoxy.conf"}) + { + if (File.Exists(file)) + File.Delete(file); + } State = State.Terminating; }