diff --git a/Greenshot/Forms/ImageEditorForm.cs b/Greenshot/Forms/ImageEditorForm.cs index e8c8eeb31..33e677078 100644 --- a/Greenshot/Forms/ImageEditorForm.cs +++ b/Greenshot/Forms/ImageEditorForm.cs @@ -32,6 +32,7 @@ using Greenshot.IniFile; using Greenshot.Plugin; using GreenshotPlugin.Controls; using GreenshotPlugin.Core; +using GreenshotPlugin.UnmanagedHelpers; using log4net; using System; using System.Collections.Generic; @@ -49,7 +50,8 @@ namespace Greenshot { public partial class ImageEditorForm : BaseForm, IImageEditor { private static readonly ILog LOG = LogManager.GetLogger(typeof(ImageEditorForm)); private static EditorConfiguration editorConfiguration = IniConfig.GetIniSection(); - private static List ignoreDestinations = new List() {PickerDestination.DESIGNATION, EditorDestination.DESIGNATION}; + private static CoreConfiguration coreConfiguration = IniConfig.GetIniSection(); + private static List ignoreDestinations = new List() { PickerDestination.DESIGNATION, EditorDestination.DESIGNATION }; private static List editorList = new List(); private Surface surface; @@ -714,6 +716,9 @@ namespace Greenshot { surface.Dispose(); GC.Collect(); + if (coreConfiguration.MinimizeWorkingSetSize) { + PsAPI.EmptyWorkingSet(); + } } void ImageEditorFormKeyDown(object sender, KeyEventArgs e) {