Browse Source

Suppress static SKFont finalizer to prevent crashes on app exit

pull/7887/head
Lubomir Tetak 5 years ago
parent
commit
d0a27b6bc4
  1. 3
      src/Skia/Avalonia.Skia/PlatformRenderInterface.cs

3
src/Skia/Avalonia.Skia/PlatformRenderInterface.cs

@ -35,6 +35,9 @@ namespace Avalonia.Skia
var gl = AvaloniaLocator.Current.GetService<IPlatformOpenGlInterface>();
if (gl != null)
_skiaGpu = new GlSkiaGpu(gl, maxResourceBytes);
//TODO: SKFont crashes when disposed in finalizer so we keep it alive
GC.SuppressFinalize(s_font);
}
public IGeometryImpl CreateEllipseGeometry(Rect rect) => new EllipseGeometryImpl(rect);

Loading…
Cancel
Save