Skip to content

Commit a69387c

Browse files
swhardensproott
andauthored
Plot.Font.Set(): prevent early disposal (ScottPlot#5047)
re-implements ScottPlot#4958 Co-authored-by: sproott <david.hrabe12@seznam.cz>
1 parent 667a80d commit a69387c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/ScottPlot5/ScottPlot5/Stylers/FontStyler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ public class FontStyler(Plot plot)
1414
public SKTypeface? Set(string fontName, FontWeight weight = FontWeight.Normal,
1515
FontSlant slant = FontSlant.Upright, FontSpacing spacing = FontSpacing.Normal)
1616
{
17-
// do nothing if the font can't be located
18-
using SKTypeface? typeFace = Fonts.GetTypeface(fontName, weight, slant, spacing);
17+
// do nothing if the font can't be located.
18+
SKTypeface? typeFace = Fonts.GetTypeface(fontName, weight, slant, spacing);
1919
if (typeFace is null)
2020
return null;
2121

0 commit comments

Comments
 (0)