pidl: Base new objects off of talloc object.
authorJelmer Vernooij <jelmer@samba.org>
Tue, 30 Nov 2010 21:59:32 +0000 (22:59 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Wed, 1 Dec 2010 00:48:24 +0000 (01:48 +0100)
pidl/lib/Parse/Pidl/Samba4/Python.pm

index 00ada47d957d6d84bf6a0ca18d0d43d581a71def..b0b8e53f44f68a22fad9cce4effc9ac208b1eb71 100644 (file)
@@ -321,22 +321,22 @@ sub PythonStruct($$$$$$)
        $self->indent;
        $self->pidl("PyObject_HEAD_INIT(NULL) 0,");
        $self->pidl(".tp_name = \"$modulename.$prettyname\",");
-       $self->pidl(".tp_basicsize = sizeof(py_talloc_Object),");
-       $self->pidl(".tp_dealloc = py_talloc_dealloc,");
        $self->pidl(".tp_getset = $getsetters,");
-       $self->pidl(".tp_repr = py_talloc_default_repr,");
-       $self->pidl(".tp_compare = py_talloc_default_cmp,");
        if ($docstring) {
                $self->pidl(".tp_doc = $docstring,");
        }
        $self->pidl(".tp_methods = $py_methods,");
        $self->pidl(".tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,");
+       $self->pidl(".tp_basicsize = sizeof(py_talloc_Object),");
        $self->pidl(".tp_new = py_$name\_new,");
        $self->deindent;
        $self->pidl("};");
 
        $self->pidl("");
 
+       my $talloc_typename = $self->import_type_variable("talloc", "Object");
+       $self->register_module_prereadycode(["$name\_Type.tp_base = $talloc_typename;", ""]);
+
        return "&$typeobject";
 }