Skip to content

Commit ecd4ee1

Browse files
committedNov 15, 2017
Destroy spatialite context after closing database
According to instructions in https://groups.google.com/forum/#!msg/spatialite-users/83SOajOJ2JU/sgi5fuYAVVkJ
1 parent 35808f1 commit ecd4ee1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed
 

‎src/core/qgsspatialiteutils.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,14 @@ sqlite3_statement_unique_ptr spatialite_database_unique_ptr::prepare( const QStr
8787

8888
void QgsSpatialiteCloser::operator()( sqlite3 *handle )
8989
{
90-
#if defined(SPATIALITE_HAS_INIT_EX)
91-
spatialite_cleanup_ex( mSpatialiteContext );
92-
mSpatialiteContext = nullptr;
93-
#endif
94-
9590
int res = sqlite3_close( handle );
9691
if ( res != SQLITE_OK )
9792
{
9893
QgsDebugMsg( QStringLiteral( "sqlite3_close() failed: %1" ).arg( res ) );
9994
}
95+
#if defined(SPATIALITE_HAS_INIT_EX)
96+
spatialite_cleanup_ex( mSpatialiteContext );
97+
mSpatialiteContext = nullptr;
98+
#endif
99+
100100
}

0 commit comments

Comments
 (0)
Please sign in to comment.