From: Jelmer Vernooij Date: Wed, 29 Dec 2010 14:58:12 +0000 (+0100) Subject: s4-python: Properly call PyObject_Del from all destructors. X-Git-Tag: tevent-0.9.11~1704 X-Git-Url: http://git.samba.org/samba.git/?a=commitdiff_plain;h=cbf504b0c5e08ccf9776f079ef2d4a0c2258241b;p=samba.git s4-python: Properly call PyObject_Del from all destructors. --- diff --git a/lib/talloc/pytalloc.c b/lib/talloc/pytalloc.c index 614b81f0571..94a163d3d9a 100644 --- a/lib/talloc/pytalloc.c +++ b/lib/talloc/pytalloc.c @@ -96,7 +96,7 @@ static void py_talloc_dealloc(PyObject* self) py_talloc_Object *obj = (py_talloc_Object *)self; assert(talloc_unlink(NULL, obj->talloc_ctx) != -1); obj->talloc_ctx = NULL; - self->ob_type->tp_free(self); + PyObject_Del(self); } /** diff --git a/source4/lib/ldb/pyldb.c b/source4/lib/ldb/pyldb.c index 354e83d8d33..d829c42ce6b 100644 --- a/source4/lib/ldb/pyldb.c +++ b/source4/lib/ldb/pyldb.c @@ -1502,7 +1502,7 @@ static PyObject *PyLdb_FromLdbContext(struct ldb_context *ldb_ctx) static void py_ldb_dealloc(PyLdbObject *self) { talloc_free(self->mem_ctx); - self->ob_type->tp_free(self); + PyObject_Del(self); } PyTypeObject PyLdb = {