Skip to content
Permalink
Browse files

Code improvement

  • Loading branch information
m-kuhn committed Nov 14, 2017
1 parent 4d20a39 commit 48e8656f17988ad8f035ac729da8f3a39e28a9ce
Showing with 6 additions and 5 deletions.
  1. +6 −5 src/core/qgsspatialiteutils.cpp
@@ -25,7 +25,8 @@
int spatialite_database_unique_ptr::open( const QString &path )
{
#if defined(SPATIALITE_HAS_INIT_EX)
get_deleter().mSpatialiteContext = spatialite_alloc_connection();
auto &deleter = get_deleter();
deleter.mSpatialiteContext = spatialite_alloc_connection();
#else
spatialite_init( 0 );
#endif
@@ -36,7 +37,7 @@ int spatialite_database_unique_ptr::open( const QString &path )

#if defined(SPATIALITE_HAS_INIT_EX)
if ( result == SQLITE_OK )
spatialite_init_ex( database, get_deleter().mSpatialiteContext, 0 );
spatialite_init_ex( database, deleter.mSpatialiteContext, 0 );
#endif

return result;
@@ -45,7 +46,8 @@ int spatialite_database_unique_ptr::open( const QString &path )
int spatialite_database_unique_ptr::open_v2( const QString &path, int flags, const char *zVfs )
{
#if defined(SPATIALITE_HAS_INIT_EX)
get_deleter().mSpatialiteContext = spatialite_alloc_connection();
auto &deleter = get_deleter();
deleter.mSpatialiteContext = spatialite_alloc_connection();
#else
spatialite_init( 0 );
#endif
@@ -56,7 +58,7 @@ int spatialite_database_unique_ptr::open_v2( const QString &path, int flags, con

#if defined(SPATIALITE_HAS_INIT_EX)
if ( result == SQLITE_OK )
spatialite_init_ex( database, get_deleter().mSpatialiteContext, 0 );
spatialite_init_ex( database, deleter.mSpatialiteContext, 0 );
#endif

return result;
@@ -80,7 +82,6 @@ sqlite3_statement_unique_ptr spatialite_database_unique_ptr::prepare( const QStr

void QgsSpatialiteCloser::operator()( sqlite3 *handle )
{

#if defined(SPATIALITE_HAS_INIT_EX)
spatialite_cleanup_ex( mSpatialiteContext );
mSpatialiteContext = nullptr;

0 comments on commit 48e8656

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