summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-12-01 00:03:08 +0100
committerJelmer Vernooij <jelmer@samba.org>2010-12-01 01:48:25 +0100
commit1f0cc6f0816abc15a24a8aa5f97e09c069e29927 (patch)
tree01a75664f27d43e6869cb1b5dba22ed0599b058d
parentf43ffed781196d25a7230f6cfd6abcaf6e5d85f6 (diff)
downloadsamba-1f0cc6f0816abc15a24a8aa5f97e09c069e29927.tar.gz
samba-1f0cc6f0816abc15a24a8aa5f97e09c069e29927.tar.bz2
samba-1f0cc6f0816abc15a24a8aa5f97e09c069e29927.zip
pyregistry: Use talloc.Object.
-rw-r--r--source4/lib/registry/pyregistry.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source4/lib/registry/pyregistry.c b/source4/lib/registry/pyregistry.c
index 8b75bbb60d..b93258a856 100644
--- a/source4/lib/registry/pyregistry.c
+++ b/source4/lib/registry/pyregistry.c
@@ -159,7 +159,6 @@ PyTypeObject PyRegistry = {
.tp_methods = registry_methods,
.tp_new = registry_new,
.tp_basicsize = sizeof(py_talloc_Object),
- .tp_dealloc = py_talloc_dealloc,
.tp_flags = Py_TPFLAGS_DEFAULT,
};
@@ -297,14 +296,12 @@ PyTypeObject PyHiveKey = {
.tp_methods = hive_key_methods,
.tp_new = hive_new,
.tp_basicsize = sizeof(py_talloc_Object),
- .tp_dealloc = py_talloc_dealloc,
.tp_flags = Py_TPFLAGS_DEFAULT,
};
PyTypeObject PyRegistryKey = {
.tp_name = "RegistryKey",
.tp_basicsize = sizeof(py_talloc_Object),
- .tp_dealloc = py_talloc_dealloc,
.tp_flags = Py_TPFLAGS_DEFAULT,
};
@@ -354,7 +351,7 @@ static PyObject *py_open_samba(PyObject *self, PyObject *args, PyObject *kwargs)
PyErr_SetWERROR(result);
return NULL;
}
-
+
return py_talloc_steal(&PyRegistry, reg_ctx);
}
@@ -474,6 +471,14 @@ static PyMethodDef py_registry_methods[] = {
void initregistry(void)
{
PyObject *m;
+ PyTypeObject *talloc_type = PyTalloc_GetObjectType();
+
+ if (talloc_type == NULL)
+ return;
+
+ PyHiveKey.tp_base = talloc_type;
+ PyRegistry.tp_base = talloc_type;
+ PyRegistryKey.tp_base = talloc_type;
if (PyType_Ready(&PyHiveKey) < 0)
return;