From 77ead87f30867443d18531812a0bbd83db1f6b0d Mon Sep 17 00:00:00 2001 From: Andrew McNamara Date: Mon, 10 Jan 2005 02:09:41 +0000 Subject: [PATCH] Add missing PyObject_GC_Track and PyObject_GC_UnTrack calls to csv reader and writer objects (other GC infrastructure already in place). --- Modules/_csv.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Modules/_csv.c b/Modules/_csv.c index 13445b8acfb..ba49236defe 100644 --- a/Modules/_csv.c +++ b/Modules/_csv.c @@ -776,6 +776,7 @@ Reader_iternext(ReaderObj *self) static void Reader_dealloc(ReaderObj *self) { + PyObject_GC_UnTrack(self); Py_XDECREF(self->dialect); Py_XDECREF(self->input_iter); Py_XDECREF(self->fields); @@ -909,6 +910,7 @@ csv_reader(PyObject *module, PyObject *args, PyObject *keyword_args) return NULL; } + PyObject_GC_Track(self); return (PyObject *)self; } @@ -1234,6 +1236,7 @@ static struct PyMemberDef Writer_memberlist[] = { static void Writer_dealloc(WriterObj *self) { + PyObject_GC_UnTrack(self); Py_XDECREF(self->dialect); Py_XDECREF(self->writeline); if (self->rec != NULL) @@ -1349,6 +1352,7 @@ csv_writer(PyObject *module, PyObject *args, PyObject *keyword_args) Py_DECREF(self); return NULL; } + PyObject_GC_Track(self); return (PyObject *)self; }