There is an unsaved comment in progress. You will lose your changes if you continue. Are you sure you want to reopen the work item?
I have created a windows desktop mapping application, using SharpMap 1.1, together with VB.NET (framework 4.0), and PostgreSQL as the spatial database.
My users (a State Bushfire Authority) have been using this application for over a year now with a large degree of success and enjoyment (well done and thank you to the developers of SharpMap).
However every now and then, most users experience a crash when using the application (message pops up saying something like: 'BRIMap.exe has stoped working and needs to close'. When looking in the Windows Application Logs, there is always a .NET Runtime error
recorded which says:
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
at System.Drawing.SafeNativeMethods+Gdip.GdipPathIterNextSubpathPath(System.Runtime.InteropServices.HandleRef, Int32 ByRef, System.Runtime.InteropServices.HandleRef, Boolean ByRef)
at System.Drawing.Drawing2D.GraphicsPathIterator.NextSubpath(System.Drawing.Drawing2D.GraphicsPath, Boolean ByRef)
at SharpMap.Rendering.Symbolizer.WarpPathToPath.Warp(System.Drawing.Drawing2D.GraphicsPath, System.Drawing.Drawing2D.GraphicsPath, Boolean, Single)
at SharpMap.Rendering.Symbolizer.WarpPathToPath.DrawString(System.Drawing.Graphics, System.Drawing.Pen, System.Drawing.Brush, System.String, System.Drawing.FontFamily, Int32, Single, System.Drawing.StringFormat, Boolean, System.Drawing.Drawing2D.GraphicsPath)
at SharpMap.Layers.LabelLayer.Render(System.Drawing.Graphics, SharpMap.Map)
at SharpMap.Map.RenderMap(System.Drawing.Graphics, SharpMap.Layers.LayerCollectionType, Boolean, Boolean)
at SharpMap.Forms.MapBox.GetMap(SharpMap.Map, SharpMap.Layers.LayerCollection, SharpMap.Layers.LayerCollectionType, GeoAPI.Geometries.Envelope)
at SharpMap.Forms.MapBox.GetImagesAsync(GeoAPI.Geometries.Envelope, Int32)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
I am using the SharpMap.Forms.MapBox control and the SharpMap.Forms.ToolBar.MapZoomToolStrip for panning and zooming operations and SharpMap.Forms.ToolBar.MapDigitizeGeometriesToolStrip for capturing new geometries.
It appears to be some form of memory issue because it occurs randomly, often when users are panning or zooming, or creating geometries, but can occur at other times when the map does not appear to be in use. The error above suggests it occurs when labels are
being rendered to the map, however I don't think it is data related, because most of the time all labels display fine, for all areas of the map (the error is not triggered by zooming to any particular map extent).
The error tends to occur more frequently on lower spec PCs (with less memory). Users PCs are a combination of windows 7 and windows 8.
I am developing in VS Express 2012 for desktop.
Does anyone have any suggestions as to how I might deal with this issue. Is it worth trying a newer (non-stable) version of the SharpMap dlls?