[Zodb-checkins] CVS: Zope3/src/zodb/btrees - BTreeTemplate.c:1.13

Tim Peters tim.one@comcast.net
Thu, 10 Apr 2003 19:40:28 -0400


Update of /cvs-repository/Zope3/src/zodb/btrees
In directory cvs.zope.org:/tmp/cvs-serv14063/src/zodb/btrees

Modified Files:
	BTreeTemplate.c 
Log Message:
BTree_deleteNextBucket():  This failed to decref the temp result from
BTree_lastBucket().  In unusual cases, this could cause a chain of buckets
to leak (the DegenerateBTree tests appeared to be the only ones that
provoked this, and there it leaked 285 IISet buckets).  Other uses of
BTree_lastBucket() appear to be refcount-correct.


=== Zope3/src/zodb/btrees/BTreeTemplate.c 1.12 => 1.13 ===
--- Zope3/src/zodb/btrees/BTreeTemplate.c:1.12	Thu Apr  3 18:39:07 2003
+++ Zope3/src/zodb/btrees/BTreeTemplate.c	Thu Apr 10 19:40:27 2003
@@ -502,12 +502,14 @@
     if (Bucket_deleteNextBucket(b) < 0)
 	goto err;
 
+    Py_DECREF(b);
     PyPersist_DECREF(self);
     PyPersist_SetATime(self);
 
     return 0;
 
  err:
+    Py_XDECREF(b);
     PyPersist_DECREF(self);
     return -1;
 }