Disposing matrix in the new code, otherwise it would cause memory leaks

This commit is contained in:
RKrom 2014-06-02 10:25:47 +02:00
parent 4d6bf9f1ad
commit 4b8ec88aaf
3 changed files with 10 additions and 4 deletions

View file

@ -303,7 +303,9 @@ namespace GreenshotPlugin.Core {
Image tmpImage;
if (outputSettings.Effects != null && outputSettings.Effects.Count > 0) {
// apply effects, if there are any
tmpImage = ImageHelper.ApplyEffects(imageToSave, outputSettings.Effects, new Matrix());
using (Matrix matrix = new Matrix()) {
tmpImage = ImageHelper.ApplyEffects(imageToSave, outputSettings.Effects, matrix);
}
if (tmpImage != null) {
if (disposeImage) {
imageToSave.Dispose();