Fix reference counting problem, triggered by subclass-able class not being subclassed, which is detected only by a debug Python build.

This commit is contained in:
Gustavo J. A. M. Carneiro committed 2008-07-22 16:31:08 +01:00
1 parent c54893328a
commit 2ebd5eafbe
1 file changed
+2 -2
+2 -2
View File
@@ -1587,9 +1587,9 @@ static void
else:
peekref_code = " && self->obj->%s() == 1" % self.memory_policy.peekref_method
visit_self = '''
if (self->obj %s)
if (self->obj && typeid(*self->obj) == typeid(%s) %s)
Py_VISIT((PyObject *) self);
''' % (peekref_code)
''' % (self.helper_class.name, peekref_code)
code_sink.writeln(r'''
static int