Skip to content

Commit

Permalink
Merge pull request AvaloniaUI#7887 from ltetak/feature/skia_crash_on_…
Browse files Browse the repository at this point in the history
…exit

Suppress static SKFont finalizer to prevent crashes on app exit
  • Loading branch information
Gillibald authored and danwalmsley committed May 24, 2022
1 parent 8a8deda commit a975408
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Skia/Avalonia.Skia/PlatformRenderInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ public PlatformRenderInterface(ISkiaGpu skiaGpu, long? maxResourceBytes = null)
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);
}

/// <inheritdoc />
Expand Down

0 comments on commit a975408

Please sign in to comment.