Skip to content

Commit

Permalink
Clear cached geometries after commit / rollback. Fixes ticket #7950
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Jun 5, 2013
1 parent 1c31a6e commit 6bbc149
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/core/qgsvectorlayer.cpp
Expand Up @@ -2592,6 +2592,11 @@ bool QgsVectorLayer::commitChanges()
QgsMessageLog::logMessage( tr( "Commit errors:\n %1" ).arg( mCommitErrors.join( "\n " ) ) );
}

if ( mCache )
{
mCache->deleteCachedGeometries();
}

updateFields();
mDataProvider->updateExtents();

Expand Down Expand Up @@ -2634,6 +2639,11 @@ bool QgsVectorLayer::rollBack( bool deleteBuffer )
}
emit editingStopped();

if ( mCache )
{
mCache->deleteCachedGeometries();
}

// invalidate the cache so the layer updates properly to show its original
// after the rollback
setCacheImage( 0 );
Expand Down

0 comments on commit 6bbc149

Please sign in to comment.