summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib')
-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;