perf: adding manual gc ensures a very small memory footprint

dev_settings
DESKTOP-3BO4HSG\ksat 2 years ago
parent c0643c40e9
commit a91965a75d

@ -18,6 +18,8 @@ namespace STranslate
if (mutex.WaitOne(0, false))
{
base.OnStartup(e);
Util.Util.FlushMemory();
}
else
{

@ -68,6 +68,8 @@ namespace STranslate.ViewModel
if (IsTopmost) return;
_speech.SpeakAsyncCancelAll();
Mainwin.Hide();
Util.Util.FlushMemory();
});
//source speak
SourceSpeakCmd = new RelayCommand((_) => true, (_) =>
@ -134,6 +136,7 @@ namespace STranslate.ViewModel
LargeHumpRet = string.Empty;
IdentifyLanguage = string.Empty;
Util.Util.FlushMemory();
}
/// <summary>
/// 打开主窗口
@ -189,6 +192,7 @@ namespace STranslate.ViewModel
/// </summary>
public void ExitApp(int id)
{
Util.Util.FlushMemory();
Mainwin.NotifyIcon.Dispose();
Mainwin.Close();
//语音合成销毁

Loading…
Cancel
Save