private static void Exit() { DialogResult ok = MessageBox.Show("Application will exit ?", "Are you sure ?", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2); if (ok == DialogResult.Yes) { var _memoryService = Gecko.Xpcom.GetService <Gecko.nsIMemory>("@mozilla.org/xpcom/memory-service;1"); _memoryService.HeapMinimize(false); fm_gecko.Close(); processCassini.Close(); threadCassini.Interrupt(); threadCassini.Abort(); close_CassiniRunning(); if (db != null) { db.Close(); } if (fm_DB != null) { fm_DB.Close(); } if (fm_login != null) { fm_login.Close(); } if (fm_log != null) { fm_log.Close(); } if (fm_noti != null) { fm_noti.Close(); } if (icon_tray != null) { icon_tray.Hide(); } Thread.Sleep(300); int pi = Process.GetCurrentProcess().Id; Process p = Process.GetProcessById(pi); p.Kill(); } }
private static void Exit() { DialogResult ok = MessageBox.Show("Application will exit ?", "Are you sure ?", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2); if (ok == DialogResult.Yes) { if (db != null) { db.Close(); } if (fm_DB != null) { fm_DB.Close(); } if (fm_login != null) { fm_login.Close(); } if (fm_log != null) { fm_log.Close(); } if (fm_noti != null) { fm_noti.Close(); } if (icon_tray != null) { icon_tray.Hide(); } Thread.Sleep(300); int pi = Process.GetCurrentProcess().Id; Process p = Process.GetProcessById(pi); p.Kill(); } }