[Gdal-dev] OGR:GetNextFeature() throws exception in WINXP

Ari Jolma ari.jolma at tkk.fi
Mon Mar 20 08:33:18 EST 2006


Vidhiyadharan Nadarajah kirjoitti:
> My problem is the same application crashes in WinXP. The function
> "poLayer->GetNextFeature()" throws an exception in winXP.Iam unable to find
> the exact exception.
...
> 
>     poLayer->ResetReading();
>     while( (poFeature = poLayer->GetNextFeature()) != NULL )
>     {
>     //OGRFeature::DestroyFeature( poFeature );
>     }
> 	OGRFeature::DestroyFeature( poFeature );
>     OGRDataSource::DestroyDataSource( poDS );
> 	return 0;

You should call DestroyFeature( poFeature ) within the loop. I just
looked at similar code of mine and I had also commented out
DestroyFeature, probably because of crashes. I tried removing it now and
there is no problem, I'm using the latest from CVS.

I don't see any reason for the crash. If you can reproduce the crash,
try adding some print statements or debug otherwise to see when the
crash happens. You could also try with the latest GDAL.

Ari

-- 
Prof. Ari Jolma
Kartografia ja Geoinformatiikka / Cartography and Geoinformatics
Teknillinen Korkeakoulu / Helsinki University of Technology
tel: +358 9 451 3886 address: POBox 1200, 02015 TKK, Finland
Email: ari.jolma at tkk.fi URL: http://www.tkk.fi/~jolma



More information about the Gdal-dev mailing list