I'm using C Sharp MapScript to access MapServer (MS4W 3.0.6).  I'm creating a 
new mapObj from an almost empty MAPFILE and then dynamically add layers to the 
map and then calling draw to generate an image.  I'm also dynamically adding 
symbolObjs to the map's symbolset for the layers to reference.  This all works 
great the vast majority of the time, but on rare occasions, sometime after the 
map has been generated, I receive the following AccessViolationException when 
garbage collection is attempting to clean up the MapServer objects.

System.AccessViolationException was unhandled
  Message=Attempted to read or write protected memory. This is often an 
indication that other memory is corrupt.
  Source=mapscript_csharp
  StackTrace:
       at OSGeo.MapServer.mapscriptPINVOKE.delete_symbolObj(HandleRef jarg1)
       at OSGeo.MapServer.symbolObj.Dispose()
       at OSGeo.MapServer.symbolObj.Finalize()
  InnerException:


I've tried disposing of the map itself, its symbolset, as well as each 
symbolObj item in that symbolset by calling Dispose on each, but doing so 
neither causes the error to happen immediately upon calling Dispose (instead it 
still only happens when garbage collection runs) nor does it do anything to 
resolve the issue.  I don't see any reference to symbolObj in the map layers 
(looks like it just holds a symbol name and/or index) nor anywhere else that 
stands out as a logical place to look, so I don't see anything else to dispose. 
 Does anyone have any idea of where I could look for any symbolObjs which have 
been allocated so I can dispose of them so that garbage collection does not 
choke when attempting to dispose of them for me?  Am I barking up the wrong 
tree and should be looking somewhere else entirely rather than focusing on 
symbolObj?

Thanks for any guidance that can be provided,
John
_______________________________________________
mapserver-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to