mirror of
https://github.com/greenshot/greenshot
synced 2025-08-21 05:53:27 -07:00
fixed destionation picker memory leak caused by external reference from delegate
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2003 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
dbd75c38cb
commit
ea0a99c021
1 changed files with 3 additions and 0 deletions
|
@ -78,6 +78,7 @@ namespace Greenshot.Destinations {
|
||||||
case ToolStripDropDownCloseReason.Keyboard:
|
case ToolStripDropDownCloseReason.Keyboard:
|
||||||
// Dispose as the close is clicked
|
// Dispose as the close is clicked
|
||||||
surface.Dispose();
|
surface.Dispose();
|
||||||
|
surface = null;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
eventArgs.Cancel = true;
|
eventArgs.Cancel = true;
|
||||||
|
@ -111,6 +112,7 @@ namespace Greenshot.Destinations {
|
||||||
// Cleanup surface, only if the destination wasn't the editor
|
// Cleanup surface, only if the destination wasn't the editor
|
||||||
if (!isEditor) {
|
if (!isEditor) {
|
||||||
surface.Dispose();
|
surface.Dispose();
|
||||||
|
surface = null;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
LOG.Info("Export failed, showing menu again");
|
LOG.Info("Export failed, showing menu again");
|
||||||
|
@ -132,6 +134,7 @@ namespace Greenshot.Destinations {
|
||||||
menu.Close();
|
menu.Close();
|
||||||
// Dispose as the close is clicked
|
// Dispose as the close is clicked
|
||||||
surface.Dispose();
|
surface.Dispose();
|
||||||
|
surface = null;
|
||||||
};
|
};
|
||||||
menu.Items.Add(closeItem);
|
menu.Items.Add(closeItem);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue