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.
28 Tcl_DeleteInterp(global_i->interp);
29 Tcl_Free(global_i->interp);
40 ldap_pvt_thread_mutex_destroy( &tcl_interpreter_mutex );
50 struct tclinfo *ti = (struct tclinfo *) bd->be_private;
51 struct i_info *ti_tmp;
53 /* Disable the interp and associated struct */
55 if (!ti->ti_ii->count && strcasecmp("default", ti->ti_ii->name)) {
56 /* no more db's using this and it's not the default */
57 for(ti_tmp = global_i; ti_tmp->next != ti->ti_ii; ti_tmp = ti_tmp->next)
59 /* This bypasses this interp struct in the global hash */
60 ti_tmp->next = ti->ti_ii->next;
61 Tcl_DeleteInterp(ti->ti_ii->interp);
71 struct tclinfo *ti = (struct tclinfo *) bd->be_private;
74 * Now free up the allocated memory used
77 if (!ti->ti_ii->count && strcasecmp("default", ti->ti_ii->name)) {
78 Tcl_Free(ti->ti_ii->interp);
82 free( bd->be_private );
83 bd->be_private = NULL;