s4-python: Properly call PyObject_Del from all destructors.
authorJelmer Vernooij <jelmer@samba.org>
Wed, 29 Dec 2010 14:58:12 +0000 (15:58 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Mon, 3 Jan 2011 00:48:04 +0000 (01:48 +0100)
lib/talloc/pytalloc.c
source4/lib/ldb/pyldb.c

index 614b81f05715487941fda03d405b52f03f28a4d0..94a163d3d9a24bf9afa8feffb0728c877247681c 100644 (file)
@@ -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);
 }
 
 /**
index 354e83d8d33be29aa55386ac6d2be1a6b57fd8e6..d829c42ce6b9dc675a0c8e291c0470eacc370a1d 100644 (file)
@@ -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 = {