[Zodb-checkins] CVS: ZODB3/BTrees - BTreeTemplate.c:1.74.10.4

Tim Peters tim.one at comcast.net
Mon Jul 7 17:07:26 EDT 2003


Update of /cvs-repository/ZODB3/BTrees
In directory cvs.zope.org:/tmp/cvs-serv10524/BTrees

Modified Files:
      Tag: zodb33-devel-branch
	BTreeTemplate.c 
Log Message:
BTree_tp_clear(), BTree_traverse():  Call the base class's tp_traverse
and tp_clear slots too.


=== ZODB3/BTrees/BTreeTemplate.c 1.74.10.3 => 1.74.10.4 ===
--- ZODB3/BTrees/BTreeTemplate.c:1.74.10.3	Mon Jul  7 15:56:03 2003
+++ ZODB3/BTrees/BTreeTemplate.c	Mon Jul  7 16:07:20 2003
@@ -1928,8 +1928,11 @@
     if (self->ob_type == &BTreeType)
 	assert(self->ob_type->tp_dictoffset == 0);
 
-    /* Per_traverse isn't implementated yet. */
-    /* err = PyPersist_TYPE->tp_traverse((PyObject *)self, visit, arg); */
+    /* Call our base type's traverse function.  Because BTrees are
+     * subclasses of Peristent, there must be one.
+     */
+    assert(self->ob_type->tp_base->tp_traverse);
+    err = self->ob_type->tp_base->tp_traverse((PyObject *)self, visit, arg);
     if (err)
 	goto Done;
 
@@ -1964,8 +1967,11 @@
 static int
 BTree_tp_clear(BTree *self)
 {
-    /* Per_clear isn't implementated yet. */
-    /* PyPersist_TYPE->tp_clear((PyObject *)self); */
+    /* Call our base type's clear function.  Because BTrees are
+     * subclasses of Peristent, there must be one.
+     */
+    assert(self->ob_type->tp_base->tp_clear);
+    self->ob_type->tp_base->tp_clear((PyObject *)self);
     if (self->state != cPersistent_GHOST_STATE)
 	_BTree_clear(self);
     return 0;




More information about the Zodb-checkins mailing list