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 --- libcli/nbt/pynbt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libcli/nbt') diff --git a/libcli/nbt/pynbt.c b/libcli/nbt/pynbt.c index 9251ecfc42..0bba2ec7a7 100644 --- a/libcli/nbt/pynbt.c +++ b/libcli/nbt/pynbt.c @@ -38,10 +38,10 @@ typedef struct { struct nbt_name_socket *socket; } nbt_node_Object; -static void py_nbt_node_dealloc(PyObject *obj) +static void py_nbt_node_dealloc(nbt_node_Object *self) { - talloc_free(((nbt_node_Object *)obj)->mem_ctx); - PyObject_Del(obj); + talloc_free(self->mem_ctx); + self->ob_type->tp_free(self); } static PyObject *py_nbt_node_init(PyTypeObject *self, PyObject *args, PyObject *kwargs) @@ -395,7 +395,7 @@ PyTypeObject nbt_node_Type = { .tp_basicsize = sizeof(nbt_node_Object), .tp_flags = Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, .tp_new = py_nbt_node_init, - .tp_dealloc = py_nbt_node_dealloc, + .tp_dealloc = (destructor)py_nbt_node_dealloc, .tp_methods = py_nbt_methods, .tp_doc = "Node()\n" "Create a new NetBIOS node\n" -- cgit