Skip to content

Commit 0626467

Browse files
rouaultnyalldawson
authored andcommittedMar 12, 2016
[BUGFIX] [Spatialite] Finalize statement in addFeatures()
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)
1 parent 35ceacc commit 0626467

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎src/providers/spatialite/qgsspatialiteprovider.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3732,6 +3732,9 @@ bool QgsSpatiaLiteProvider::addFeatures( QgsFeatureList & flist )
37323732
break;
37333733
}
37343734
}
3735+
3736+
sqlite3_finalize( stmt );
3737+
37353738
if ( ret == SQLITE_DONE || ret == SQLITE_ROW )
37363739
{
37373740
ret = sqlite3_exec( sqliteHandle, "COMMIT", nullptr, nullptr, &errMsg );

0 commit comments

Comments
 (0)
Please sign in to comment.