[fdo-users] FDO 3.6.0: AccessViolationException in cleanup IGeometry

Ray ray.wu at efacec.com
Thu Oct 20 12:22:02 EDT 2011


In FDO 3.6.0, I got AccessViolationException in cleanup IGeometry.

The following is the exception information:

************** Exception Text **************
System.AccessViolationException: Attempted to read or write protected
memory. This is often an indication that other memory is corrupt.
   at OSGeo.FDO.Runtime.Disposable.ReleaseUnmanagedObject()
   at OSGeo.FDO.Runtime.Disposable.!Disposable()
   at OSGeo.FDO.Runtime.Disposable.Dispose(Boolean )
   at OSGeo.FDO.Runtime.Disposable.Finalize()


The following is the code snippet:

byteArray = oFeatureReader.GetGeometry("GEOMETRY")
 Using gisGeometry As OSGeo.FDO.Geometry.IGeometry =
agfGeoFactory.CreateGeometryFromFgf(byteArray)

            '--------------------------------------
            'Cast the geometry to a position
            '--------------------------------------
            Dim myPosition As OSGeo.FDO.Geometry.IPoint
            If TypeOf gisGeometry Is OSGeo.FDO.Geometry.IPoint Then
                myPosition = gisGeometry
                dInsertionPoint(0) = myPosition.Position.X
                dInsertionPoint(1) = myPosition.Position.Y
            Else
                dInsertionPoint(0) = gisGeometry.Envelope.MinX
                dInsertionPoint(1) = gisGeometry.Envelope.MinY
            End If

 End Using

If I don't use "USING" statement which cleanup the memory, it runs fine
without exception.

This should be a bug for FDO3.6.0. Any idea how I can workaround the
exception but still have the memory cleaned?

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/FDO-3-6-0-AccessViolationException-in-cleanup-IGeometry-tp6913596p6913596.html
Sent from the FDO Users mailing list archive at Nabble.com.


More information about the fdo-users mailing list