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.
11 * $Id: tcl_close.c,v 1.2 1999/02/17 00:55:03 bcollins Exp $
13 * $Log: tcl_close.c,v $
14 * Revision 1.2 1999/02/17 00:55:03 bcollins
15 * Implemented all of the (db_)destroy and (db_)close functions
31 Tcl_DeleteInterp(global_i->interp);
41 Tcl_Free(global_i->interp);
43 ldap_pvt_thread_mutex_destroy( &tcl_interpreter_mutex );
53 struct tclinfo *ti = (struct tclinfo *) bd->be_private;
54 struct i_info *ti_tmp;
56 /* Disable the interp and associated struct */
58 if (!ti->ti_ii->count && strcasecmp("default", ti->ti_ii->name)) {
59 /* no more db's using this and it's not the default */
60 for(ti_tmp = global_i; ti_tmp->next != ti->ti_ii; ti_tmp = ti_tmp->next)
62 /* This bypasses this interp struct in the global hash */
63 ti_tmp->next = ti->ti_ii->next;
64 Tcl_DeleteInterp(ti->ti_ii->interp);
74 struct tclinfo *ti = (struct tclinfo *) bd->be_private;
77 * Now free up the allocated memory used
80 if (!ti->ti_ii->count && strcasecmp("default", ti->ti_ii->name)) {
81 Tcl_Free(ti->ti_ii->interp);
85 free( bd->be_private );
86 bd->be_private = NULL;