Call the correct tp_dealloc.
This commit is contained in:
parent
84b7447752
commit
c572e42fb4
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue