Skip to content

Commit

Permalink
Merge pull request #5305 from boundlessgeo/issue_15498_waitRenedering…
Browse files Browse the repository at this point in the history
…EndToAvoidLock

for SQlite vectors wait rendering end to avoid file lock: fixes #15498
  • Loading branch information
elpaso authored Oct 12, 2017
2 parents 5e097d8 + 206965c commit 6321923
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8003,6 +8003,18 @@ void QgisApp::saveEdits( QgsMapLayer *layer, bool leaveEditable, bool triggerRep
if ( vlayer == activeLayer() )
mSaveRollbackInProgress = true;

// stop rendering to avoid lock in case of
// splilte and gpkg fix #15498
if ( mMapCanvas->mapSettings().layers().contains( vlayer->id() ) )
{
if ( vlayer->dataProvider()->storageType().count( "SQLite" ) ||
vlayer->dataProvider()->storageType().count( "GPKG" ) )
{
if ( mMapCanvas->isDrawing() )
mMapCanvas->stopRendering();
}
}

if ( !vlayer->commitChanges() )
{
mSaveRollbackInProgress = false;
Expand Down

0 comments on commit 6321923

Please sign in to comment.