summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico Di Gregorio <fog@initd.org>2005-11-24 03:21:37 +0000
committerFederico Di Gregorio <fog@initd.org>2005-11-24 03:21:37 +0000
commit81bc23a54e756a185cb3e8778db5ee3f9080e1df (patch)
tree8a9d87f3db9bac0e8b149a24f216252731902a88
parenta6be5bf7bc47357dc5ee52603356ab890f798b65 (diff)
downloadpsycopg2-81bc23a54e756a185cb3e8778db5ee3f9080e1df.tar.gz
Fixed problem with type object dealloc.
-rw-r--r--psycopg/typecast.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/psycopg/typecast.c b/psycopg/typecast.c
index d0a3d8a..1788563 100644
--- a/psycopg/typecast.c
+++ b/psycopg/typecast.c
@@ -367,7 +367,7 @@ typecast_dealloc(PyObject *obj)
Py_XDECREF(self->name);
Py_XDECREF(self->pcast);
- obj->ob_type->tp_free(obj);
+ PyObject_Del(self);
}
static PyObject *
@@ -452,6 +452,8 @@ typecast_new(PyObject *name, PyObject *values, PyObject *cast, PyObject *base)
obj = PyObject_NEW(typecastObject, &typecastType);
if (obj == NULL) return NULL;
+ Dprintf("typecast_new: new type at = %p, refcnt = %d", obj, obj->ob_refcnt);
+
Py_INCREF(values);
obj->values = values;