From e3550a65eb0380b6026947d5ad8f4db272d99e55 Mon Sep 17 00:00:00 2001 From: Neil Schemenauer Date: Wed, 4 Oct 2000 16:20:41 +0000 Subject: - fix a GC bug caused by malloc() failing --- Objects/classobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- cgit v0.12