Skip to content
Permalink
Browse files

[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).
  • Loading branch information
rouault committed Mar 10, 2016
1 parent e6785ba commit b0f2b970ac8918e5cb0ec566ecb491a57054a093
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/providers/spatialite/qgsspatialiteprovider.cpp
@@ -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 );

0 comments on commit b0f2b97

Please sign in to comment.
You can’t perform that action at this time.