[Zope3-checkins] CVS: Zope3/src/zope/app/container - _zope_app_container_contained.c:1.2.10.3

Jim Fulton jim at zope.com
Fri Jan 30 11:17:27 EST 2004


Update of /cvs-repository/Zope3/src/zope/app/container
In directory cvs.zope.org:/tmp/cvs-serv10120/src/zope/app/container

Modified Files:
      Tag: zope3-zodb3-devel-branch
	_zope_app_container_contained.c 
Log Message:
Fixed a bug in tp_dealloc.  The slot needs to call the base-class,
Persistent, tp_dealloc, so that the object gets removed from the
zodb object cache.


=== Zope3/src/zope/app/container/_zope_app_container_contained.c 1.2.10.2 => 1.2.10.3 ===
--- Zope3/src/zope/app/container/_zope_app_container_contained.c:1.2.10.2	Fri Jan 16 10:43:30 2004
+++ Zope3/src/zope/app/container/_zope_app_container_contained.c	Fri Jan 30 11:16:56 2004
@@ -231,6 +231,8 @@
   return 0;
 }
 
+#define CLEAR(O) tmp = O; O = NULL; Py_XDECREF(tmp);
+
 static int
 CP_clear(ProxyObject *self)
 {
@@ -246,7 +248,6 @@
   if (cPersistenceType->tp_clear != NULL)
     cPersistenceType->tp_clear((PyObject*)self);
 
-#define CLEAR(O) tmp = O; O = NULL; Py_XDECREF(tmp);
   
   CLEAR(self->po_serial);
   CLEAR(self->proxy_object);
@@ -259,12 +260,17 @@
 static void
 CP_dealloc(ProxyObject *self)
 {
+  PyObject *tmp;
+
   if (self->po_weaklist != NULL)
     PyObject_ClearWeakRefs((PyObject *)self);
 
-  PyObject_GC_UnTrack((PyObject *)self);
-  CP_clear(self);
-  self->ob_type->tp_free((PyObject*)self);
+  CLEAR(self->po_serial);
+  CLEAR(self->proxy_object);
+  CLEAR(self->__parent__);
+  CLEAR(self->__name__);
+
+  cPersistenceType->tp_dealloc((PyObject*)self);
 }
 
 #ifndef PyMODINIT_FUNC	/* declarations for DLL import/export */




More information about the Zope3-Checkins mailing list