From 5792fa90ace06f736661d9924ec9a75c3a0a9771 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 29 Dec 2010 18:56:13 +0100 Subject: s4-python: Only set BASETYPE flag if subclassing is supported. Autobuild-User: Jelmer Vernooij Autobuild-Date: Sat Jan 1 03:39:58 CET 2011 on sn-devel-104 --- lib/talloc/pytalloc.c | 4 +--- lib/tdb/pytdb.c | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/talloc/pytalloc.c b/lib/talloc/pytalloc.c index a8c46c96f8..614b81f057 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; - PyObject_Del(self); + self->ob_type->tp_free(self); } /** @@ -112,8 +112,6 @@ static int py_talloc_default_cmp(PyObject *_obj1, PyObject *_obj2) return ((char *)py_talloc_get_ptr(obj1) - (char *)py_talloc_get_ptr(obj2)); } - - static PyTypeObject TallocObject_Type = { .tp_name = "talloc.Object", .tp_doc = "Python wrapper for a talloc-maintained object.", diff --git a/lib/tdb/pytdb.c b/lib/tdb/pytdb.c index 981459efef..0faba562de 100644 --- a/lib/tdb/pytdb.c +++ b/lib/tdb/pytdb.c @@ -479,7 +479,7 @@ static void tdb_object_dealloc(PyTdbObject *self) { if (!self->closed) tdb_close(self->ctx); - PyObject_Del(self); + self->ob_type->tp_free(self); } static PyObject *obj_getitem(PyTdbObject *self, PyObject *key) -- cgit