]> granicus.if.org Git - python/commitdiff
Fixed a memory leak that was introduced with incorrect usage of the Python weak
authorGerhard Häring <gh@ghaering.de>
Mon, 19 Jun 2006 21:17:35 +0000 (21:17 +0000)
committerGerhard Häring <gh@ghaering.de>
Mon, 19 Jun 2006 21:17:35 +0000 (21:17 +0000)
reference API in pysqlite 2.2.1.

Bumbed pysqlite version number to upcoming pysqlite 2.3.1 release.

Modules/_sqlite/connection.c
Modules/_sqlite/module.h

index ca7aad84ec7bbf7573da7c4ce0d40ae760bd788d..703af15fa939c2faee575b0028e2d8d7ed44c672 100644 (file)
@@ -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;
index 00eff1f6ab11913f4438cd3e03b23b591dd6c995..3fdac615b397c3f82e138c465d14c3ed377859f4 100644 (file)
@@ -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;