mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-01-31 09:24:07 +03:00
* psycopg/adapter_asis.c (asis_traverse): add cyclic GC traversal
for AsIs adapters.
This commit is contained in:
parent
fd538a8b17
commit
47d2414e32
|
@ -1,5 +1,8 @@
|
|||
2008-07-01 James Henstridge <james@jamesh.id.au>
|
||||
|
||||
* psycopg/adapter_asis.c (asis_traverse): add cyclic GC traversal
|
||||
for AsIs adapters.
|
||||
|
||||
* psycopg/adapter_list.c (list_traverse): add cyclic GC traversal
|
||||
for list adapters.
|
||||
|
||||
|
|
|
@ -106,6 +106,13 @@ asis_setup(asisObject *self, PyObject *obj)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
asis_traverse(asisObject *self, visitproc visit, void *arg)
|
||||
{
|
||||
Py_VISIT(self->wrapped);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
asis_dealloc(PyObject* obj)
|
||||
{
|
||||
|
@ -141,7 +148,7 @@ asis_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
|||
static void
|
||||
asis_del(PyObject* self)
|
||||
{
|
||||
PyObject_Del(self);
|
||||
PyObject_GC_Del(self);
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
|
@ -183,10 +190,10 @@ PyTypeObject asisType = {
|
|||
0, /*tp_setattro*/
|
||||
0, /*tp_as_buffer*/
|
||||
|
||||
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /*tp_flags*/
|
||||
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
|
||||
asisType_doc, /*tp_doc*/
|
||||
|
||||
0, /*tp_traverse*/
|
||||
(traverseproc)asis_traverse, /*tp_traverse*/
|
||||
0, /*tp_clear*/
|
||||
|
||||
0, /*tp_richcompare*/
|
||||
|
|
Loading…
Reference in New Issue
Block a user