mirror of
https://github.com/greenshot/greenshot
synced 2025-08-13 02:07:07 -07:00
Fixed potential memory leak.
This commit is contained in:
parent
89c8104715
commit
4d6bf9f1ad
1 changed files with 5 additions and 3 deletions
|
@ -110,9 +110,11 @@ namespace Greenshot.Drawing {
|
||||||
SetArrowHeads((ArrowHeadCombination)GetFieldValue(FieldType.ARROWHEADS), pen);
|
SetArrowHeads((ArrowHeadCombination)GetFieldValue(FieldType.ARROWHEADS), pen);
|
||||||
using (GraphicsPath path = new GraphicsPath()) {
|
using (GraphicsPath path = new GraphicsPath()) {
|
||||||
path.AddLine(Left, Top, Left + Width, Top + Height);
|
path.AddLine(Left, Top, Left + Width, Top + Height);
|
||||||
Rectangle drawingBounds = Rectangle.Round(path.GetBounds(new Matrix(), pen));
|
using (Matrix matrix = new Matrix()) {
|
||||||
drawingBounds.Inflate(2, 2);
|
Rectangle drawingBounds = Rectangle.Round(path.GetBounds(matrix, pen));
|
||||||
return drawingBounds;
|
drawingBounds.Inflate(2, 2);
|
||||||
|
return drawingBounds;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue