QgsOgrProvider::addAttributes(): call invalidateConnections() for MapInfo

This commit is contained in:
Even Rouault 2016-05-04 15:51:33 +02:00
parent 8ea447065c
commit 02be0cb4d1

View File

@ -1212,6 +1212,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 )