From ecd2010951cac5a525a36906bdb803de1f619bb1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Gerhard=20H=C3=A4ring?= Date: Mon, 19 Jun 2006 21:17:35 +0000 Subject: [PATCH] Fixed a memory leak that was introduced with incorrect usage of the Python weak reference API in pysqlite 2.2.1. Bumbed pysqlite version number to upcoming pysqlite 2.3.1 release. --- Modules/_sqlite/connection.c | 2 +- Modules/_sqlite/module.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c index ca7aad84ec..703af15fa9 100644 --- a/Modules/_sqlite/connection.c +++ b/Modules/_sqlite/connection.c @@ -664,7 +664,7 @@ void _drop_unused_statement_references(Connection* self) for (i = 0; i < PyList_Size(self->statements); i++) { weakref = PyList_GetItem(self->statements, i); - if (weakref != Py_None) { + if (PyWeakref_GetObject(weakref) != Py_None) { if (PyList_Append(new_list, weakref) != 0) { Py_DECREF(new_list); return; diff --git a/Modules/_sqlite/module.h b/Modules/_sqlite/module.h index 00eff1f6ab..3fdac615b3 100644 --- a/Modules/_sqlite/module.h +++ b/Modules/_sqlite/module.h @@ -25,7 +25,7 @@ #define PYSQLITE_MODULE_H #include "Python.h" -#define PYSQLITE_VERSION "2.3.0" +#define PYSQLITE_VERSION "2.3.1" extern PyObject* Error; extern PyObject* Warning; -- 2.40.0