mirror of
https://github.com/greenshot/greenshot
synced 2025-08-19 04:59:30 -07:00
Merge from branch for Exit problems
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@743 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
701e3ead3b
commit
f84b227d47
1 changed files with 26 additions and 15 deletions
|
@ -537,23 +537,34 @@ namespace Greenshot {
|
||||||
/// Exit/cleanup
|
/// Exit/cleanup
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void exit() {
|
public void exit() {
|
||||||
// Inform all registed plugins
|
try {
|
||||||
PluginHelper.instance.Shutdown();
|
// Make sure hotkeys are disabled
|
||||||
|
HotkeyHelper.UnregisterHotkeys((int)this.Handle);
|
||||||
// Make the Greenshot icon invisible
|
|
||||||
notifyIcon.Visible = false;
|
// Now the sound isn't needed anymore
|
||||||
|
SoundHelper.Deinitialize();
|
||||||
conf.Store();
|
|
||||||
HotkeyHelper.UnregisterHotkeys((int)this.Handle);
|
// Making sure all Windows are closed, gracefull shutdown
|
||||||
SoundHelper.Deinitialize();
|
Application.Exit();
|
||||||
if (applicationMutex != null) {
|
|
||||||
try {
|
// Inform all registed plugins
|
||||||
applicationMutex.ReleaseMutex();
|
PluginHelper.instance.Shutdown();
|
||||||
} catch (Exception ex) {
|
|
||||||
LOG.Error("Error releasing Mutex!", ex);
|
// Store any open configuration changes
|
||||||
|
conf.Store();
|
||||||
|
} finally {
|
||||||
|
// Remove the application mutex
|
||||||
|
if (applicationMutex != null) {
|
||||||
|
try {
|
||||||
|
applicationMutex.ReleaseMutex();
|
||||||
|
} catch (Exception ex) {
|
||||||
|
LOG.Error("Error releasing Mutex!", ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// make the icon invisible otherwise it stays even after exit!!
|
||||||
|
notifyIcon.Visible = false;
|
||||||
}
|
}
|
||||||
Application.Exit();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue