Skip to content

Commit

Permalink
also spatialite_cleanup_ex conditional for spatialite >= 4
Browse files Browse the repository at this point in the history
  • Loading branch information
blazek committed May 27, 2015
1 parent 9639fc6 commit 58f9372
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/ext-libs/pyspatialite/src/connection.c
Expand Up @@ -280,7 +280,9 @@ void pysqlite_connection_dealloc(pysqlite_Connection* self)
if (self->db) {
Py_BEGIN_ALLOW_THREADS
sqlite3_close(self->db);
#if defined(SPATIALITE_VERSION_GE_4_0_0)
spatialite_cleanup_ex( self->slconn );
#endif
Py_END_ALLOW_THREADS
} else if (self->apsw_connection) {
ret = PyObject_CallMethod(self->apsw_connection, "close", "");
Expand Down Expand Up @@ -381,7 +383,9 @@ PyObject* pysqlite_connection_close(pysqlite_Connection* self, PyObject* args)
} else {
Py_BEGIN_ALLOW_THREADS
rc = sqlite3_close(self->db);
#if defined(SPATIALITE_VERSION_GE_4_0_0)
spatialite_cleanup_ex( self->slconn );
#endif
Py_END_ALLOW_THREADS

if (rc != SQLITE_OK) {
Expand Down

0 comments on commit 58f9372

Please sign in to comment.