summaryrefslogtreecommitdiff
path: root/libcli/nbt
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-12-29 18:56:13 +0100
committerJelmer Vernooij <jelmer@samba.org>2011-01-01 03:39:58 +0100
commit5792fa90ace06f736661d9924ec9a75c3a0a9771 (patch)
tree189f5bcd84247351d641f758cc914cf99b6af407 /libcli/nbt
parentf5fe9c32ef833d3f1ee4b891f46e94382aa182fe (diff)
downloadsamba-5792fa90ace06f736661d9924ec9a75c3a0a9771.tar.gz
samba-5792fa90ace06f736661d9924ec9a75c3a0a9771.tar.bz2
samba-5792fa90ace06f736661d9924ec9a75c3a0a9771.zip
s4-python: Only set BASETYPE flag if subclassing is supported.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Sat Jan 1 03:39:58 CET 2011 on sn-devel-104
Diffstat (limited to 'libcli/nbt')
-rw-r--r--libcli/nbt/pynbt.c8
1 files changed, 4 insertions, 4 deletions
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"