Hello all 

The following function uses c++ operator new to get a pointer of OGRLinearRing 
and modified that ring. Before the function returns, it's neccessary to delete 
that pointer,but  "delete poFLinear;" will cause a runtime error and the 
program stops running. What should I do to delete that pointer? Thanks.

 
int GetWSInfo(const vector<Point> &ring,OUT CWSInfo & wsinfo)
{
 OGRLinearRing *poFLinear = new OGRLinearRing();
 poFLinear->setPoints(ring.size(),(OGRRawPoint*)(&ring[0]));
 poFLinear->closeRings();
 OGRPolygon * poFPoly = new OGRPolygon();
 poFPoly->addRingDirectly(poFLinear);
 wsinfo.WSAREA = poFLinear->get_Area();
 wsinfo.WSPERI = poFLinear->get_Length();
 //delete poFLinear;
 //delete poFPoly;
 return RETURN_OK;
}
_______________________________________________
gdal-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to