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
commit 4b8ec88aaf
3 changed files with 10 additions and 4 deletions

View file

@ -879,6 +879,9 @@ namespace Greenshot.Drawing {
if (_surfaceSizeChanged != null && !imageRectangle.Equals(new Rectangle(Point.Empty, newImage.Size))) {
_surfaceSizeChanged(this, null);
}
} else {
// clean up matrix, as it hasn't been used in the undo stack.
matrix.Dispose();
}
} finally {
// Always close the background form