[FWTools] OGRFeature memory problem?

Mike Toothaker mtoothaker at milcord.com
Mon May 15 10:50:24 EDT 2006



> -----Original Message-----
> From: Mateusz Łoskot [mailto:mateusz at loskot.net]
> Sent: Monday, May 15, 2006 10:26 AM
> To: Mike Toothaker
> Subject: Re: [FWTools] OGRFeature memory problem?
> 
> Mike Toothaker wrote:
> >
> > Thank you very much for the quick response.  Using:
> >
> > OGRFeature::DestroyFeature( poFeature );
> >
> > Unfortunately gives the same result.
> 
> Hi,
> 
> Could you try to change your code as follows:
> 
> 1)    OGRPoint *poPoint = new OGRPoint();
> 
> Simply, put this point on the stack:
> 
> OGRPoint pt;
> 
> 2) Change
> oFeature->SetGeometryDirectly( poPoint );
> 
> to read:
> 
> oFeature->SetGeometry( &pt );
> 
> Is it working now?
> 
> Cheers
> --
> Mateusz Łoskot
> http://mateusz.loskot.net

You are my new hero.  :-)  That seems to have done the trick.  So basically
the problem wasn't in the cleaning up of the OGRFeature necessarily so much
as probably cleaning up the OGRPoint object, is this correct?

Thank you very much.  It worked on my little test, now hopefully it will
work in the real project as well.  

Thank you again,
Mike





More information about the FWTools mailing list