mirror of
https://github.com/greenshot/greenshot
synced 2025-08-20 05:23:24 -07:00
Fixed memory leak when closing the destination picker by using the keyboard (e.g. ESC or Alt+F4). This might solve bug #3556050, if nothing else is reported.
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1983 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
f8475bc24f
commit
b589d756d6
1 changed files with 12 additions and 9 deletions
|
@ -63,15 +63,18 @@ namespace Greenshot.Destinations {
|
|||
ContextMenuStrip menu = new ContextMenuStrip();
|
||||
menu.Closing += delegate(object source, ToolStripDropDownClosingEventArgs eventArgs) {
|
||||
LOG.DebugFormat("Close reason: {0}", eventArgs.CloseReason);
|
||||
switch (eventArgs.CloseReason) {
|
||||
case ToolStripDropDownCloseReason.ItemClicked:
|
||||
case ToolStripDropDownCloseReason.CloseCalled:
|
||||
case ToolStripDropDownCloseReason.Keyboard:
|
||||
break;
|
||||
default:
|
||||
eventArgs.Cancel = true;
|
||||
break;
|
||||
}
|
||||
switch (eventArgs.CloseReason) {
|
||||
case ToolStripDropDownCloseReason.ItemClicked:
|
||||
case ToolStripDropDownCloseReason.CloseCalled:
|
||||
break;
|
||||
case ToolStripDropDownCloseReason.Keyboard:
|
||||
// Dispose as the close is clicked
|
||||
surface.Dispose();
|
||||
break;
|
||||
default:
|
||||
eventArgs.Cancel = true;
|
||||
break;
|
||||
}
|
||||
};
|
||||
foreach (IDestination destination in destinations) {
|
||||
// Fix foreach loop variable for the delegate
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue