Skip to content

Commit 58f9372

Browse files
committed
also spatialite_cleanup_ex conditional for spatialite >= 4
1 parent 9639fc6 commit 58f9372

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

python/ext-libs/pyspatialite/src/connection.c

+4
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,9 @@ void pysqlite_connection_dealloc(pysqlite_Connection* self)
280280
if (self->db) {
281281
Py_BEGIN_ALLOW_THREADS
282282
sqlite3_close(self->db);
283+
#if defined(SPATIALITE_VERSION_GE_4_0_0)
283284
spatialite_cleanup_ex( self->slconn );
285+
#endif
284286
Py_END_ALLOW_THREADS
285287
} else if (self->apsw_connection) {
286288
ret = PyObject_CallMethod(self->apsw_connection, "close", "");
@@ -381,7 +383,9 @@ PyObject* pysqlite_connection_close(pysqlite_Connection* self, PyObject* args)
381383
} else {
382384
Py_BEGIN_ALLOW_THREADS
383385
rc = sqlite3_close(self->db);
386+
#if defined(SPATIALITE_VERSION_GE_4_0_0)
384387
spatialite_cleanup_ex( self->slconn );
388+
#endif
385389
Py_END_ALLOW_THREADS
386390

387391
if (rc != SQLITE_OK) {

0 commit comments

Comments
 (0)