mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 02:37:03 -07:00
Fixed exit bug (no cleanup being made)
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@720 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
e8fd1b02ee
commit
01c02d9f99
1 changed files with 21 additions and 14 deletions
|
@ -328,20 +328,7 @@ namespace Greenshot {
|
|||
#region mainform events
|
||||
void MainFormFormClosing(object sender, FormClosingEventArgs e) {
|
||||
LOG.Info("Closing with reason: " + e.CloseReason);
|
||||
|
||||
// Inform all registed plugins
|
||||
PluginHelper.instance.Shutdown();
|
||||
|
||||
conf.Store();
|
||||
HotkeyHelper.UnregisterHotkeys((int)this.Handle);
|
||||
SoundHelper.Deinitialize();
|
||||
if (applicationMutex != null) {
|
||||
try {
|
||||
applicationMutex.ReleaseMutex();
|
||||
} catch (Exception ex) {
|
||||
LOG.Error("Error releasing Mutex!", ex);
|
||||
}
|
||||
}
|
||||
exit();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
@ -435,6 +422,7 @@ namespace Greenshot {
|
|||
}
|
||||
|
||||
void Contextmenu_exitClick(object sender, EventArgs e) {
|
||||
exit();
|
||||
Application.Exit();
|
||||
}
|
||||
|
||||
|
@ -536,5 +524,24 @@ namespace Greenshot {
|
|||
private void ImageWritten(object sender, ImageOutputEventArgs eventArgs) {
|
||||
lastImagePath = Path.GetDirectoryName(eventArgs.FullPath);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Exit/cleanup
|
||||
/// </summary>
|
||||
private void exit() {
|
||||
// Inform all registed plugins
|
||||
PluginHelper.instance.Shutdown();
|
||||
|
||||
conf.Store();
|
||||
HotkeyHelper.UnregisterHotkeys((int)this.Handle);
|
||||
SoundHelper.Deinitialize();
|
||||
if (applicationMutex != null) {
|
||||
try {
|
||||
applicationMutex.ReleaseMutex();
|
||||
} catch (Exception ex) {
|
||||
LOG.Error("Error releasing Mutex!", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue