[Gdal-dev] Memory Leak? OGRGeometryFactory::forcetoMultiPolygon

Craig Miller craig.miller at spatialminds.com
Mon Nov 13 11:55:21 EST 2006


Is there any cleanup code necessary when working with
OGRGeometryFactory::forceToMultiPolygon?

The following snippit appears to cause a leak:
pDstFeature->SetGeometryDirectly(
OGRGeometryFactory::forceToMultiLineString(pDstFeature->StealGeometry()));

And just to verify that it wasn't the StealGeometry/SetGeometryDirectly
portion I verified that replacing the above code with this does not leak:
pDstFeature->SetGeometryDirectly( pDstFeature->StealGeometry());

Thanks for taking a look.
--Craig




More information about the Gdal-dev mailing list