Skip to content

Commit

Permalink
fix feature leak
Browse files Browse the repository at this point in the history
  • Loading branch information
mdsumner committed Jun 14, 2024
1 parent aeb863d commit 9a3bb12
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions inst/include/gdallibrary/gdallibrary.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,11 @@ inline R_xlen_t force_layer_feature_count(OGRLayer *poLayer) {
if (out == -1) {
out = 0;
poLayer->ResetReading();
while(poLayer->GetNextFeature() != NULL) {
out++;
OGRFeature *poFeature;
while( (poFeature = poLayer->GetNextFeature()) != NULL )
{
out++;
OGRFeature::DestroyFeature( poFeature );
}
poLayer->ResetReading();
}
Expand Down

0 comments on commit 9a3bb12

Please sign in to comment.