Skip to content

Commit

Permalink
[OGR] Don't call repack after OGR_L_SyncToDisk if compiled against gd…
Browse files Browse the repository at this point in the history
…al-2.2.0+

OGR_L_SyncToDisk internally does a repack with gdal-2.2.0 onwards
  • Loading branch information
manisandro committed Oct 4, 2017
1 parent 4e2e360 commit 7eb2475
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/providers/ogr/qgsogrprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3409,13 +3409,16 @@ bool QgsOgrProvider::syncToDisc()
pushError( tr( "OGR error syncing to disk: %1" ).arg( CPLGetLastErrorMsg() ) );
}

// Repack is done automatically on OGR_L_SyncToDisk with gdal-2.2.0+
#if !defined(GDAL_VERSION_NUM) || GDAL_VERSION_NUM < 2020000
if ( !mDeferRepack )
{
if ( mShapefileMayBeCorrupted )
repack();

mShapefileMayBeCorrupted = false;
}
#endif

QgsOgrConnPool::instance()->ref( dataSourceUri() );
if ( shapeIndex )
Expand Down

0 comments on commit 7eb2475

Please sign in to comment.