ThinkGeo.com    |     Documentation    |     Premium Support

AccessViolationException Randomly On Startup

Greetings,

On initial map startup/display, will sometimes receive the following exception

System.AccessViolationException: ‘Attempted to read or write protected memory. This is often an indication that other memory is corrupt.’

SkiaSharp.dll!SkiaSharp.SkiaApi.sk_image_read_pixels_into_pixmap(System.IntPtr image, System.IntPtr dst, int srcX, int srcY, SkiaSharp.SKImageCachingHint cachingHint)	Unknown
SkiaSharp.dll!SkiaSharp.SKImage.ReadPixels(SkiaSharp.SKPixmap pixmap, int srcX, int srcY, SkiaSharp.SKImageCachingHint cachingHint)	Unknown
ThinkGeo.UI.Wpf.dll!CxQ=.Xkw=.X0w=(ThinkGeo.Core.GeoImage geoImage)	Unknown

ThinkGeo.UI.Wpf.dll!ThinkGeo.Core.TileView.CommitDrawingAsyncCore.AnonymousMethod__0() Unknown

When drawing a graticule layer.

Thanks Fred,
I tested with the sample https://gitlab.com/thinkgeo/public/thinkgeo-desktop-maps/-/blob/master/samples/wpf/HowDoISample/Samples/DisplayingLayers/Vector/GraticuleLayerSample.xaml.cs

It works fine. Could you attach your demo project we could look into more detail.

Thanks

Frank

We were missing a refresh at the end of our loaded function when adding overlays/layers.

Haven’t had it happen at startup again yet, but will ping if it does.

Think the issue was without that refresh, could get in a state on startup where it’d still be writing to the graticule layer but also trying to read from the scale adornment layer before it finished.

Thanks Fred,
Good to know you find the reason. Go ahead let us know if you have any more question.

Thanks

Frank