private void Application_Exit(object sender, ExitEventArgs e) { // save settings and fix autorun status. reduce startup time SettingManager.WriteFile(FileConfigXml, FilePreferenceXml); if (SettingManager.Configuration.IsAutorun) { SystemUtil.CheckOrCreateUserStartupShortcut(); } else { SystemUtil.DeleteUserStartupShortcuts(); } // shutdown service TransmitCtrl.StopServer(); TransmitCtrl.EnableTransmit(false); InterfaceCtrl.Dispose(); ServerManager.Dispose(); Model.IPAddress.IPInformation.Dispose(); // not important ProcPrivoxy.KillRunning(); ProcSS.KillRunning(); ProcV2Ray.KillRunning(); }