Skip to content

Commit

Permalink
QgsOgrProvider::addAttributes(): call invalidateConnections() for Map…
Browse files Browse the repository at this point in the history
…Info
  • Loading branch information
rouault committed May 29, 2016
1 parent fe32ba4 commit 657ac10
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/providers/ogr/qgsogrprovider.cpp
Expand Up @@ -1103,6 +1103,13 @@ bool QgsOgrProvider::addAttributes( const QList<QgsField> &attributes )
if ( !doInitialActionsForEdition() )
return false;

if ( ogrDriverName == "MapInfo File" )
{
// adding attributes in mapinfo requires to be able to delete the .dat file
// so drop any cached connections.
QgsOgrConnPool::instance()->invalidateConnections( filePath() );
}

bool returnvalue = true;

for ( QList<QgsField>::const_iterator iter = attributes.begin(); iter != attributes.end(); ++iter )
Expand Down

0 comments on commit 657ac10

Please sign in to comment.