// Form1 is closing; let's do a clean log out of the universe first private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e) { // Turn off & kill Cadence and the (if running) if (Globals.iCadenceOn == true) { try { aCadence.Stop(); aTimer.Stop(); } catch { } //aCadence.Change(Timeout.Infinite, Timeout.Infinite); Stat(1, "Cadence", "Cadence turned off", "black"); Globals.iCadenceOn = false; } // Kill everything else try { m_bot.HudClear(0); m_bot.Exit(); Utility.Wait(0); m_bot.Dispose(); Globals.m_db.Close(); } catch { } Stat(1, "Logout", "Logged out.", "black"); //_instance.Dispose(); //Utility.Wait(0); }