mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-02-07 12:50:32 +03:00
* psycopg/adapter_list.c (list_traverse): add cyclic GC traversal
for list adapters.
This commit is contained in:
parent
26693621ef
commit
fd538a8b17
|
@ -1,3 +1,8 @@
|
||||||
|
2008-07-01 James Henstridge <james@jamesh.id.au>
|
||||||
|
|
||||||
|
* psycopg/adapter_list.c (list_traverse): add cyclic GC traversal
|
||||||
|
for list adapters.
|
||||||
|
|
||||||
2008-05-28 James Henstridge <james@jamesh.id.au>
|
2008-05-28 James Henstridge <james@jamesh.id.au>
|
||||||
|
|
||||||
* psycopg/cursor_type.c (cursor_setup): incref before setting
|
* psycopg/cursor_type.c (cursor_setup): incref before setting
|
||||||
|
|
|
@ -179,6 +179,16 @@ list_setup(listObject *self, PyObject *obj, const char *enc)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
list_traverse(PyObject *obj, visitproc visit, void *arg)
|
||||||
|
{
|
||||||
|
listObject *self = (listObject *)obj;
|
||||||
|
|
||||||
|
Py_VISIT(self->wrapped);
|
||||||
|
Py_VISIT(self->connection);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
list_dealloc(PyObject* obj)
|
list_dealloc(PyObject* obj)
|
||||||
{
|
{
|
||||||
|
@ -215,7 +225,7 @@ list_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
||||||
static void
|
static void
|
||||||
list_del(PyObject* self)
|
list_del(PyObject* self)
|
||||||
{
|
{
|
||||||
PyObject_Del(self);
|
PyObject_GC_Del(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
|
@ -253,11 +263,11 @@ PyTypeObject listType = {
|
||||||
0, /*tp_setattro*/
|
0, /*tp_setattro*/
|
||||||
0, /*tp_as_buffer*/
|
0, /*tp_as_buffer*/
|
||||||
|
|
||||||
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
|
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
|
||||||
|
|
||||||
listType_doc, /*tp_doc*/
|
listType_doc, /*tp_doc*/
|
||||||
|
|
||||||
0, /*tp_traverse*/
|
list_traverse, /*tp_traverse*/
|
||||||
0, /*tp_clear*/
|
0, /*tp_clear*/
|
||||||
|
|
||||||
0, /*tp_richcompare*/
|
0, /*tp_richcompare*/
|
||||||
|
|
Loading…
Reference in New Issue
Block a user