Skip to content

Commit

Permalink
[BUGFIX] [Spatialite] Finalize statement in addFeatures()
Browse files Browse the repository at this point in the history
The sqlite3_prepare_v2() call in QgsSpatiaLiteProvider::addFeatures() is
not associated with a matching sqlite3_finalize(). Consequently at
time of sqlite3_close(), the later returns a SQLITE_BUSY error and
fails to close the file descriptor (can be checked by runing 'lsof' on
qgis process).

(cherry-picked from b0f2b97)
  • Loading branch information
rouault authored and nyalldawson committed Mar 12, 2016
1 parent 35ceacc commit 0626467
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/providers/spatialite/qgsspatialiteprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3732,6 +3732,9 @@ bool QgsSpatiaLiteProvider::addFeatures( QgsFeatureList & flist )
break;
}
}

sqlite3_finalize( stmt );

if ( ret == SQLITE_DONE || ret == SQLITE_ROW )
{
ret = sqlite3_exec( sqliteHandle, "COMMIT", nullptr, nullptr, &errMsg );
Expand Down

0 comments on commit 0626467

Please sign in to comment.