mirror of
https://github.com/greenshot/greenshot
synced 2025-08-19 04:59:30 -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
|
#region mainform events
|
||||||
void MainFormFormClosing(object sender, FormClosingEventArgs e) {
|
void MainFormFormClosing(object sender, FormClosingEventArgs e) {
|
||||||
LOG.Info("Closing with reason: " + e.CloseReason);
|
LOG.Info("Closing with reason: " + e.CloseReason);
|
||||||
|
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -435,6 +422,7 @@ namespace Greenshot {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Contextmenu_exitClick(object sender, EventArgs e) {
|
void Contextmenu_exitClick(object sender, EventArgs e) {
|
||||||
|
exit();
|
||||||
Application.Exit();
|
Application.Exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -536,5 +524,24 @@ namespace Greenshot {
|
||||||
private void ImageWritten(object sender, ImageOutputEventArgs eventArgs) {
|
private void ImageWritten(object sender, ImageOutputEventArgs eventArgs) {
|
||||||
lastImagePath = Path.GetDirectoryName(eventArgs.FullPath);
|
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