diff options
author | Neil Schemenauer <nascheme@enme.ucalgary.ca> | 2000-10-04 16:20:41 (GMT) |
---|---|---|
committer | Neil Schemenauer <nascheme@enme.ucalgary.ca> | 2000-10-04 16:20:41 (GMT) |
commit | e3550a65eb0380b6026947d5ad8f4db272d99e55 (patch) | |
tree | 373eb205156eddf9f81e6eb44a3ac354c3e8a893 /Objects/classobject.c | |
parent | 15f06661c17dfc2e6aee4432cc2225cd3e518ee8 (diff) | |
download | cpython-e3550a65eb0380b6026947d5ad8f4db272d99e55.zip cpython-e3550a65eb0380b6026947d5ad8f4db272d99e55.tar.gz cpython-e3550a65eb0380b6026947d5ad8f4db272d99e55.tar.bz2 |
- fix a GC bug caused by malloc() failing
Diffstat (limited to 'Objects/classobject.c')
-rw-r--r-- | Objects/classobject.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/classobject.c b/Objects/classobject.c index 19059fc..c362b80 100644 --- a/Objects/classobject.c +++ b/Objects/classobject.c @@ -437,7 +437,6 @@ PyInstance_New(PyObject *class, PyObject *arg, PyObject *kw) if (inst == NULL) return NULL; inst->in_dict = PyDict_New(); - PyObject_GC_Init(inst); if (inst->in_dict == NULL) { inst = (PyInstanceObject *) PyObject_AS_GC(inst); PyObject_DEL(inst); @@ -445,6 +444,7 @@ PyInstance_New(PyObject *class, PyObject *arg, PyObject *kw) } Py_INCREF(class); inst->in_class = (PyClassObject *)class; + PyObject_GC_Init(inst); if (initstr == NULL) initstr = PyString_InternFromString("__init__"); init = instance_getattr2(inst, initstr); |