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

Vidhiyadharan Nadarajah vdharan2001 at gmail.com
Fri Mar 17 18:29:25 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

Ari,
I have downloaded the latest source and tested the same application. But
again the application crashes when i do Destroy feature inside the loop.
If i put it outside the loop, the application dosen't crash in win2k but
crashes in WINXP.
I have added some debug print and the crash happens when the
GetNextFeature() is being called.
I want to make the application run in WINXP.

Best Regards,
N.Vidhiyadharan
--
Internal Virus Database is out-of-date.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.15.12/266 - Release Date: 21/02/2006




More information about the Gdal-dev mailing list