From 3540c42bf4ac403b4a82e970b0e3566ffdc48407 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Sun, 14 Apr 2002 23:33:31 +0000 Subject: Shutdown cli_state in the dealloc function. This happens automatically when a handle object falls out of scope. (This used to be commit 39546dd241b36d5e7b8e239525a13b91e4e9db80) --- source3/python/py_spoolss.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'source3/python/py_spoolss.c') diff --git a/source3/python/py_spoolss.c b/source3/python/py_spoolss.c index 450abbd6dc..b92e3c1758 100644 --- a/source3/python/py_spoolss.c +++ b/source3/python/py_spoolss.c @@ -192,6 +192,15 @@ Set the form given by the dictionary argument. static void py_policy_hnd_dealloc(PyObject* self) { + spoolss_policy_hnd_object *hnd; + + /* Close down policy handle and free talloc context */ + + hnd = (spoolss_policy_hnd_object*)self; + + cli_shutdown(hnd->cli); + talloc_destroy(hnd->mem_ctx); + PyObject_Del(self); } @@ -337,8 +346,7 @@ void initspoolss(void) module = Py_InitModule("spoolss", spoolss_methods); dict = PyModule_GetDict(module); - /* Make spools_error global an exception we can raise when an error - occurs. */ + /* Exceptions we can raise */ spoolss_error = PyErr_NewException("spoolss.error", NULL, NULL); PyDict_SetItemString(dict, "error", spoolss_error); -- cgit