diff --git a/STranslate/App.xaml.cs b/STranslate/App.xaml.cs index 16fce42..dfd23a5 100644 --- a/STranslate/App.xaml.cs +++ b/STranslate/App.xaml.cs @@ -18,6 +18,8 @@ namespace STranslate if (mutex.WaitOne(0, false)) { base.OnStartup(e); + + Util.Util.FlushMemory(); } else { diff --git a/STranslate/ViewModel/MainVM.cs b/STranslate/ViewModel/MainVM.cs index 8af5913..f1bb44a 100644 --- a/STranslate/ViewModel/MainVM.cs +++ b/STranslate/ViewModel/MainVM.cs @@ -68,6 +68,8 @@ namespace STranslate.ViewModel if (IsTopmost) return; _speech.SpeakAsyncCancelAll(); Mainwin.Hide(); + + Util.Util.FlushMemory(); }); //source speak SourceSpeakCmd = new RelayCommand((_) => true, (_) => @@ -133,7 +135,8 @@ namespace STranslate.ViewModel SmallHumpRet = string.Empty; LargeHumpRet = string.Empty; IdentifyLanguage = string.Empty; - + + Util.Util.FlushMemory(); } /// /// 打开主窗口 @@ -189,6 +192,7 @@ namespace STranslate.ViewModel /// public void ExitApp(int id) { + Util.Util.FlushMemory(); Mainwin.NotifyIcon.Dispose(); Mainwin.Close(); //语音合成销毁