mirror of
https://github.com/greenshot/greenshot
synced 2025-07-31 04:00:13 -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);
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue