summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorNeil Schemenauer <nascheme@enme.ucalgary.ca>2000-09-15 18:57:21 (GMT)
committerNeil Schemenauer <nascheme@enme.ucalgary.ca>2000-09-15 18:57:21 (GMT)
commitce20967c2c4d1aa1333bcda5a3d8a86587af70b0 (patch)
tree88dca9f851c031e7af25689877da35d5b2c751bf /Objects
parente64572bccbb8b22e7e384ae1a7009532d389a850 (diff)
downloadcpython-ce20967c2c4d1aa1333bcda5a3d8a86587af70b0.zip
cpython-ce20967c2c4d1aa1333bcda5a3d8a86587af70b0.tar.gz
cpython-ce20967c2c4d1aa1333bcda5a3d8a86587af70b0.tar.bz2
Don't remove instance objects from the GC container set until we are
they are dead. Fixes bug #113812.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/classobject.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Objects/classobject.c b/Objects/classobject.c
index 8bbd834..d963fe1 100644
--- a/Objects/classobject.c
+++ b/Objects/classobject.c
@@ -490,7 +490,6 @@ instance_dealloc(register PyInstanceObject *inst)
#ifdef Py_TRACE_REFS
extern long _Py_RefTotal;
#endif
- PyObject_GC_Fini(inst);
/* Call the __del__ method if it exists. First temporarily
revive the object and save the current exception, if any. */
#ifdef Py_TRACE_REFS
@@ -523,7 +522,6 @@ instance_dealloc(register PyInstanceObject *inst)
#ifdef COUNT_ALLOCS
inst->ob_type->tp_free--;
#endif
- PyObject_GC_Init((PyObject *)inst);
return; /* __del__ added a reference; don't delete now */
}
#ifdef Py_TRACE_REFS
@@ -535,6 +533,7 @@ instance_dealloc(register PyInstanceObject *inst)
inst->ob_type = NULL;
#endif
#endif /* Py_TRACE_REFS */
+ PyObject_GC_Fini(inst);
Py_DECREF(inst->in_class);
Py_XDECREF(inst->in_dict);
inst = (PyInstanceObject *) PyObject_AS_GC(inst);