SkiaSharp icon indicating copy to clipboard operation
SkiaSharp copied to clipboard

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

Open joshminor opened this issue 5 years ago • 4 comments

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

joshminor avatar Jun 02 '20 14:06 joshminor

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

joshminor avatar Jul 21 '20 19:07 joshminor

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.

BurkusCat avatar Sep 04 '20 09:09 BurkusCat

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.

radev8 avatar Dec 17 '20 21:12 radev8

I think this could be the same problem as #1490 (or at least the underlying cause could be the same)

MartinZikmund avatar Dec 16 '21 09:12 MartinZikmund