]> granicus.if.org Git - python/commitdiff
Call the correct tp_dealloc.
authorJack Jansen <jack.jansen@cwi.nl>
Thu, 15 Jul 2004 21:24:07 +0000 (21:24 +0000)
committerJack Jansen <jack.jansen@cwi.nl>
Thu, 15 Jul 2004 21:24:07 +0000 (21:24 +0000)
Tools/bgen/bgen/bgenObjectDefinition.py

index 40435ad2ac80c1c779b0ed96d6e066019cab5387..9c205e392b4c2c3d6baf5994be13c0fb653d4370 100644 (file)
@@ -135,7 +135,7 @@ class ObjectDefinition(GeneratorGroup):
         OutLbrace()
         self.outputCleanupStructMembers()
         if self.basetype:
-            Output("%s.tp_dealloc(self)", self.basetype)
+            Output("self->ob_type->tp_base->tp_dealloc((PyObject *)self);")
         elif hasattr(self, 'output_tp_free'):
             # This is a new-style object with tp_free slot
             Output("self->ob_type->tp_free((PyObject *)self);")
@@ -210,7 +210,7 @@ class ObjectDefinition(GeneratorGroup):
     def outputTypeObjectInitializer(self):
         Output("""%s.ob_type = &PyType_Type;""", self.typename)
         if self.basetype:
-            Output("%s.tp_base = %s;", self.typename, self.basetype)
+            Output("%s.tp_base = &%s;", self.typename, self.basetype)
         Output("if (PyType_Ready(&%s) < 0) return;", self.typename)
         Output("""Py_INCREF(&%s);""", self.typename)
         Output("PyModule_AddObject(m, \"%s\", (PyObject *)&%s);", self.name, self.typename);