From 5a7a1dfab98872ff2f9b15081e750abc4ac7cbf6 Mon Sep 17 00:00:00 2001 From: RKrom Date: Tue, 17 Jun 2014 10:32:56 +0200 Subject: [PATCH] Added EmptyWorkingSet in the editor, this is only called if the configuration allows this. --- Greenshot/Forms/ImageEditorForm.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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) {