Skiasharp: [BUG] [UWP] Crash after removing SKGLView from page

Created on 2 Jun 2020  路  3Comments  路  Source: mono/SkiaSharp

Description

When more than one SKGLView is added to a page, removing one will cause a crash.
This was originally discovered while integrating Mapsui (https://github.com/Mapsui/Mapsui/issues/935), but I believe the issue is within SkiaSharp.
I've tested this on Android and iOS without issue, it appears to only be within the UWP project.

STR

  • Add an SKGLView to page.
  • Add another SKGLView to page.
  • Remove second SKGLView
  • Do something to make the first element refresh (resize window, etc.)
  • Crash!

Basic Information

  • IDE: VS2019
  • SkiaSharp.Views 1.68.3
  • SkiaSharp.Views.Forms 1.68.3
  • Xamarin.Forms 4.6.0.800
  • UWP: 1803

Screenshots
image

Reproduction Link
SKGLViewCrash.zip

backend-OpenGL os-Windows-Universal-UWP type-bug

All 3 comments

Just going to mention that I tried the latest 2.80.1 and this is still a problem

I'm observing this when I have a map on a page, open a popup with a map, and close the popup. If I remove the first map (the one on the page) there is no error.

I have found this also happens across pages. Open a second page with SKGLView and then navigate back to the first page, then get the original SKGLView to redraw and crash.

Is there a way to trigger the release of the GlesContext after a painting or after triggering a navigate to a new window? The only trigger at the moment is when the form is Garbage collected, but this occurs only after the new page is visible.

Was this page helpful?
0 / 5 - 0 ratings