diff options
author | Oleksandr Shulgin <oleksandr.shulgin@zalando.de> | 2015-07-03 15:44:45 +0200 |
---|---|---|
committer | Oleksandr Shulgin <oleksandr.shulgin@zalando.de> | 2015-07-03 15:44:45 +0200 |
commit | eac16d048ac597e3602e7ebddb3ea191e0537cff (patch) | |
tree | f48f2efcebf12b40e29870a478dcebc5597071cd /psycopg | |
parent | 06f18237f7932aab066cae2c09b6e335af5225f2 (diff) | |
download | psycopg2-eac16d048ac597e3602e7ebddb3ea191e0537cff.tar.gz |
Fix missing GC flag in ReplicationMessage type
Diffstat (limited to 'psycopg')
-rw-r--r-- | psycopg/replication_message_type.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/psycopg/replication_message_type.c b/psycopg/replication_message_type.c index e52b32e..edfe6c1 100644 --- a/psycopg/replication_message_type.c +++ b/psycopg/replication_message_type.c @@ -70,6 +70,14 @@ replmsg_init(PyObject *obj, PyObject *args, PyObject *kwargs) } static int +replmsg_traverse(replicationMessageObject *self, visitproc visit, void *arg) +{ + Py_VISIT((PyObject* )self->cursor); + Py_VISIT(self->payload); + return 0; +} + +static int replmsg_clear(replicationMessageObject *self) { Py_CLEAR(self->cursor); @@ -154,10 +162,10 @@ PyTypeObject replicationMessageType = { 0, /*tp_getattro*/ 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*/ replicationMessageType_doc, /*tp_doc*/ - 0, /*tp_traverse*/ + (traverseproc)replmsg_traverse, /*tp_traverse*/ (inquiry)replmsg_clear, /*tp_clear*/ 0, /*tp_richcompare*/ 0, /*tp_weaklistoffset*/ |