[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).
This commit is contained in:
Even Rouault 2016-03-10 12:47:23 +01:00
parent e6785ba513
commit b0f2b970ac

View File

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