Fixed potential memory leak.

This commit is contained in:
RKrom 2014-06-02 09:35:01 +02:00
parent 89c8104715
commit 4d6bf9f1ad

View file

@ -110,9 +110,11 @@ namespace Greenshot.Drawing {
SetArrowHeads((ArrowHeadCombination)GetFieldValue(FieldType.ARROWHEADS), pen);
using (GraphicsPath path = new GraphicsPath()) {
path.AddLine(Left, Top, Left + Width, Top + Height);
Rectangle drawingBounds = Rectangle.Round(path.GetBounds(new Matrix(), pen));
drawingBounds.Inflate(2, 2);
return drawingBounds;
using (Matrix matrix = new Matrix()) {
Rectangle drawingBounds = Rectangle.Round(path.GetBounds(matrix, pen));
drawingBounds.Inflate(2, 2);
return drawingBounds;
}
}
}
}