From 0a37ace76cdbfd6eed9a3b7ebd9dbbe1b0974982 Mon Sep 17 00:00:00 2001 From: RKrom Date: Wed, 28 Jul 2010 13:23:26 +0000 Subject: [PATCH] Fixed exit git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@735 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4 --- Greenshot/Forms/CaptureForm.cs | 2 +- Greenshot/Forms/MainForm.cs | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Greenshot/Forms/CaptureForm.cs b/Greenshot/Forms/CaptureForm.cs index 4e083e37d..1f4c962a9 100644 --- a/Greenshot/Forms/CaptureForm.cs +++ b/Greenshot/Forms/CaptureForm.cs @@ -94,7 +94,7 @@ namespace Greenshot.Forms { LOG.Debug("Data received, Command = " + dataTransport.Command + ", Data: " + dataTransport.CommandData); switch(dataTransport.Command) { case CommandEnum.Exit: - Application.Exit(); + MainForm.instance.exit(); break; case CommandEnum.ReloadConfig: AppConfig.Reload(); diff --git a/Greenshot/Forms/MainForm.cs b/Greenshot/Forms/MainForm.cs index cd39300dd..b9a0adb52 100644 --- a/Greenshot/Forms/MainForm.cs +++ b/Greenshot/Forms/MainForm.cs @@ -137,6 +137,7 @@ namespace Greenshot { // unregister application on uninstall (allow uninstall) if (argument.Equals("--uninstall") || argument.Equals("uninstall")) { try { + LOG.Info("Sending all instances the exit command."); // Pass Exit to running instance, if any dataTransport = new DataTransport(CommandEnum.Exit, args[0]); SendData(dataTransport); @@ -431,7 +432,6 @@ namespace Greenshot { void Contextmenu_exitClick(object sender, EventArgs e) { exit(); - Application.Exit(); } private void InitializeQuickSettingsMenu() { @@ -536,12 +536,12 @@ namespace Greenshot { /// /// Exit/cleanup /// - private void exit() { + public void exit() { // Inform all registed plugins PluginHelper.instance.Shutdown(); // Make the Greenshot icon invisible - notifyIcon.Visible = true; + notifyIcon.Visible = false; conf.Store(); HotkeyHelper.UnregisterHotkeys((int)this.Handle); @@ -553,6 +553,7 @@ namespace Greenshot { LOG.Error("Error releasing Mutex!", ex); } } + Application.Exit(); } } }