diff options
author | James Henstridge <james@jamesh.id.au> | 2008-07-21 13:41:54 +0800 |
---|---|---|
committer | James Henstridge <james@jamesh.id.au> | 2008-07-21 13:41:54 +0800 |
commit | 2273b79be912ab46e58418b077d50d59d5e4511c (patch) | |
tree | 931b85fc6b7397924ca4defa0ff9e5b432b428f2 /psycopg/adapter_pboolean.c | |
parent | e0287c0db4ceb3daca64b2e3dd32397b357b7e3c (diff) | |
download | psycopg2-2273b79be912ab46e58418b077d50d59d5e4511c.tar.gz |
Use Py_CLEAR() in a few more places, and do INCREF's before setting
struct members rather than afterwards.
Diffstat (limited to 'psycopg/adapter_pboolean.c')
-rw-r--r-- | psycopg/adapter_pboolean.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/psycopg/adapter_pboolean.c b/psycopg/adapter_pboolean.c index 29e3410..1ce80dd 100644 --- a/psycopg/adapter_pboolean.c +++ b/psycopg/adapter_pboolean.c @@ -106,8 +106,8 @@ pboolean_setup(pbooleanObject *self, PyObject *obj) self, ((PyObject *)self)->ob_refcnt ); + Py_INCREF(obj); self->wrapped = obj; - Py_INCREF(self->wrapped); Dprintf("pboolean_setup: good pboolean object at %p, refcnt = " FORMAT_CODE_PY_SSIZE_T, @@ -130,7 +130,7 @@ pboolean_dealloc(PyObject* obj) { pbooleanObject *self = (pbooleanObject *)obj; - Py_XDECREF(self->wrapped); + Py_CLEAR(self->wrapped); Dprintf("pboolean_dealloc: deleted pboolean object at %p, refcnt = " FORMAT_CODE_PY_SSIZE_T, |