If there is a memory leak, it will be in gdiplus.dll
, FontFamily.IsStyleAvailable()
actually making an external call GdipIsStyleAvailable()
.
From ILSpy:
public bool IsStyleAvailable(FontStyle style)
{
int num2;
int num = SafeNativeMethods.Gdip.GdipIsStyleAvailable(new HandleRef(this, this.NativeFamily), style, out num2);
if (num != 0)
{
throw SafeNativeMethods.Gdip.StatusException(num);
}
return num2 != 0;
}
This, in turn, is defined as:
[DllImport("gdiplus.dll", CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)]
internal static extern int GdipIsStyleAvailable(HandleRef family, FontStyle style, out int isStyleAvailable);
source
share