Skip to content

Commit

Permalink
Fix memory leaks by using sqlite3_close_v2
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kuhn committed Nov 20, 2017
1 parent 3eced50 commit 6d0f2af
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/core/qgsspatialiteutils.cpp
Expand Up @@ -75,10 +75,10 @@ sqlite3_statement_unique_ptr spatialite_database_unique_ptr::prepare( const QStr

void QgsSpatialiteCloser::operator()( sqlite3 *handle )
{
int res = sqlite3_close( handle );
int res = sqlite3_close_v2( handle );
if ( res != SQLITE_OK )
{
QgsDebugMsg( QStringLiteral( "sqlite3_close() failed: %1" ).arg( res ) );
QgsDebugMsg( QStringLiteral( "sqlite3_close_v2() failed: %1" ).arg( res ) );
}

spatialite_cleanup_ex( mSpatialiteContext );
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgssqliteutils.cpp
Expand Up @@ -21,7 +21,7 @@

void QgsSqlite3Closer::operator()( sqlite3 *database )
{
sqlite3_close( database );
sqlite3_close_v2( database );
}

void QgsSqlite3StatementFinalizer::operator()( sqlite3_stmt *statement )
Expand Down

0 comments on commit 6d0f2af

Please sign in to comment.