2 /* close.c - tcl close routines
4 * Copyright 1999, Ben Collins <bcollins@debian.org>, All rights reserved.
6 * Redistribution and use in source and binary forms are permitted only
7 * as authorized by the OpenLDAP Public License. A copy of this
8 * license is available at http://www.OpenLDAP.org/license.html or
9 * in file LICENSE in the top-level directory of the distribution.
24 Tcl_DeleteInterp (global_i->interp);
34 free (global_i->interp);
36 ldap_pvt_thread_mutex_destroy (&tcl_interpreter_mutex);
46 struct tclinfo *ti = (struct tclinfo *) bd->be_private;
47 struct i_info *ti_tmp;
49 /* Disable the interp and associated struct */
51 if (!ti->ti_ii->count && strcasecmp ("default", ti->ti_ii->name)) {
52 /* no more db's using this and it's not the default */
53 for (ti_tmp = global_i; ti_tmp->next != ti->ti_ii; ti_tmp
55 /* This bypasses this interp struct in the global hash */
56 ti_tmp->next = ti->ti_ii->next;
57 Tcl_DeleteInterp (ti->ti_ii->interp);
67 struct tclinfo *ti = (struct tclinfo *) bd->be_private;
70 * Now free up the allocated memory used
73 if (!ti->ti_ii->count && strcasecmp ("default", ti->ti_ii->name)) {
74 free (ti->ti_ii->interp);
78 free (bd->be_private);
79 bd->be_private = NULL;