Added EmptyWorkingSet in the editor, this is only called if the configuration allows this.

This commit is contained in:
RKrom 2014-06-17 10:32:56 +02:00
commit 5a7a1dfab9

View file

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