From ea0a99c021c6aeb45fa78566643f278f5d4a807a Mon Sep 17 00:00:00 2001 From: JKlingen Date: Sun, 2 Sep 2012 19:23:34 +0000 Subject: [PATCH] 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 --- Greenshot/Destinations/PickerDestination.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Greenshot/Destinations/PickerDestination.cs b/Greenshot/Destinations/PickerDestination.cs index 9ccf8477b..0e7262e25 100644 --- a/Greenshot/Destinations/PickerDestination.cs +++ b/Greenshot/Destinations/PickerDestination.cs @@ -78,6 +78,7 @@ namespace Greenshot.Destinations { case ToolStripDropDownCloseReason.Keyboard: // Dispose as the close is clicked surface.Dispose(); + surface = null; break; default: eventArgs.Cancel = true; @@ -111,6 +112,7 @@ namespace Greenshot.Destinations { // Cleanup surface, only if the destination wasn't the editor if (!isEditor) { surface.Dispose(); + surface = null; } } else { LOG.Info("Export failed, showing menu again"); @@ -132,6 +134,7 @@ namespace Greenshot.Destinations { menu.Close(); // Dispose as the close is clicked surface.Dispose(); + surface = null; }; menu.Items.Add(closeItem);