Closed GoogleCodeExporter closed 9 years ago
Original comment by mmcc...@gmail.com
on 19 Feb 2014 at 8:41
Fixed in 3096.
Note: this is a "bug" on OGR side the function
OGRFeature::SetGeometryDirectly().
This function should take ownership of the passed geometry. But, it doesn't
work on windows (works on Mac). Therefore, I need to use
OGRFeature::SetGeometry() instead. At the same time, I tried to manually clean
the memory of exported geometries.
Original comment by lixun...@gmail.com
on 4 Mar 2014 at 6:33
Here is a note to fix this issue potentially.
http://osdir.com/ml/gdal-development-gis-osgeo/2013-05/msg00086.html
I am guessing you are working on Windows and are running into problems with a
mix of runtime heaps. I would suggest avoiding using new and delete directly
and instead leaving everything to functions from the GDAL DLL.
I believe you should use OGRGeometryFactory::createGeometry(wkbLinearRing) to
create the linear ring (use wkbPolygon for the polygon) and
OGRGeometryFactory::destroyGeometry() to destroy geometries.
Keep in mind that addRingDirectly() transfers ownership of the ring to the
polygon so you should not destroy the ring after that. It will be cleaned up
by the polygon when that is destroyed.
Best regards,Frank
Original comment by lixun...@gmail.com
on 4 Mar 2014 at 9:25
Fixed in ci 3098
Original comment by lixun...@gmail.com
on 5 Mar 2014 at 10:46
Original comment by lixun...@gmail.com
on 5 Mar 2014 at 10:46
Original issue reported on code.google.com by
lixun...@gmail.com
on 18 Feb 2014 at 10:24