1 /* close.c - tcl close routines
3 * $Id: tcl_close.c,v 1.3 1999/02/17 01:02:11 bcollins Exp $
5 * Copyright 1999, Ben Collins <bcollins@debian.org>, All rights reserved.
7 * Redistribution and use in source and binary forms are permitted only
8 * as authorized by the OpenLDAP Public License. A copy of this
9 * license is available at http://www.OpenLDAP.org/license.html or
10 * in file LICENSE in the top-level directory of the distribution.
25 Tcl_DeleteInterp (global_i->interp);
35 free (global_i->interp);
37 ldap_pvt_thread_mutex_destroy (&tcl_interpreter_mutex);
47 struct tclinfo *ti = (struct tclinfo *) bd->be_private;
48 struct i_info *ti_tmp;
50 /* Disable the interp and associated struct */
52 if (!ti->ti_ii->count && strcasecmp ("default", ti->ti_ii->name)) {
53 /* no more db's using this and it's not the default */
54 for (ti_tmp = global_i; ti_tmp->next != ti->ti_ii; ti_tmp
56 /* This bypasses this interp struct in the global hash */
57 ti_tmp->next = ti->ti_ii->next;
58 Tcl_DeleteInterp (ti->ti_ii->interp);
68 struct tclinfo *ti = (struct tclinfo *) bd->be_private;
71 * Now free up the allocated memory used
74 if (!ti->ti_ii->count && strcasecmp ("default", ti->ti_ii->name)) {
75 free (ti->ti_ii->interp);
79 free (bd->be_private);
80 bd->be_private = NULL;