[Zodb-checkins] CVS: Zope3/src/zope/interface - _zope_interface_ospec.c:1.3

Jim Fulton jim at zope.com
Fri May 16 09:46:39 EDT 2003


Update of /cvs-repository/Zope3/src/zope/interface
In directory cvs.zope.org:/tmp/cvs-serv1896

Modified Files:
	_zope_interface_ospec.c 
Log Message:
Fixed a memory leak in the interface specification base type. 
(I forgot to define a deallocator.)  


=== Zope3/src/zope/interface/_zope_interface_ospec.c 1.2 => 1.3 ===
--- Zope3/src/zope/interface/_zope_interface_ospec.c:1.2	Thu May 15 17:56:30 2003
+++ Zope3/src/zope/interface/_zope_interface_ospec.c	Fri May 16 08:46:38 2003
@@ -29,6 +29,13 @@
   PyObject *__signature__;
 } ISB;
 
+static void
+ISB_dealloc(ISB *self)
+{
+  Py_XDECREF(self->__signature__);
+  self->ob_type->tp_free((PyObject*)self);
+}
+
 static PyMemberDef ISB_members[] = {
   { "__signature__", T_OBJECT_EX, offsetof(ISB, __signature__), 0 },
   {NULL}	/* Sentinel */
@@ -45,7 +52,7 @@
                                 "InterfaceSpecificationBase",
 	/* tp_basicsize      */ sizeof(ISB),
 	/* tp_itemsize       */ 0,
-	/* tp_dealloc        */ (destructor)0,
+	/* tp_dealloc        */ (destructor)ISB_dealloc,
 	/* tp_print          */ (printfunc)0,
 	/* tp_getattr        */ (getattrfunc)0,
 	/* tp_setattr        */ (setattrfunc)0,




More information about the Zodb-checkins mailing list