Skip to content

Commit 6d0f2af

Browse files
committedNov 20, 2017
Fix memory leaks by using sqlite3_close_v2
1 parent 3eced50 commit 6d0f2af

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

‎src/core/qgsspatialiteutils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ sqlite3_statement_unique_ptr spatialite_database_unique_ptr::prepare( const QStr
7575

7676
void QgsSpatialiteCloser::operator()( sqlite3 *handle )
7777
{
78-
int res = sqlite3_close( handle );
78+
int res = sqlite3_close_v2( handle );
7979
if ( res != SQLITE_OK )
8080
{
81-
QgsDebugMsg( QStringLiteral( "sqlite3_close() failed: %1" ).arg( res ) );
81+
QgsDebugMsg( QStringLiteral( "sqlite3_close_v2() failed: %1" ).arg( res ) );
8282
}
8383

8484
spatialite_cleanup_ex( mSpatialiteContext );

‎src/core/qgssqliteutils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
void QgsSqlite3Closer::operator()( sqlite3 *database )
2323
{
24-
sqlite3_close( database );
24+
sqlite3_close_v2( database );
2525
}
2626

2727
void QgsSqlite3StatementFinalizer::operator()( sqlite3_stmt *statement )

0 commit comments

Comments
 (0)
Please sign in to comment.