More for dynamic dbenv swapping

This commit is contained in:
Howard Chu 2005-04-22 23:02:01 +00:00
parent 3f20324ed0
commit 2d277bef3b
2 changed files with 5 additions and 4 deletions

View File

@ -425,6 +425,8 @@ bdb_cf_gen(ConfigArgs *c)
ch_free( bdb->bi_db_config_path );
bdb->bi_db_config_path = NULL;
c->cleanup = bdb_cf_cleanup;
ldap_pvt_thread_pool_purgekey( bdb->bi_dbenv );
ldap_pvt_thread_pool_purgekey( ((char *)bdb->bi_dbenv) + 1 );
break;
case BDB_NOSYNC:
bdb->bi_dbenv->set_flags( bdb->bi_dbenv, DB_TXN_NOSYNC, 0 );

View File

@ -571,7 +571,7 @@ bdb_db_close( BackendDB *be )
ber_bvarray_free( bdb->bi_db_config );
bdb->bi_db_config = NULL;
while( bdb->bi_ndatabases-- ) {
while( bdb->bi_databases && bdb->bi_ndatabases-- ) {
db = bdb->bi_databases[bdb->bi_ndatabases];
rc = db->bdi_db->close( db->bdi_db, 0 );
/* Lower numbered names are not strdup'd */
@ -582,9 +582,6 @@ bdb_db_close( BackendDB *be )
free( bdb->bi_databases );
bdb->bi_databases = NULL;
bdb_attr_index_destroy( bdb->bi_attrs );
bdb->bi_attrs = NULL;
bdb_cache_release_all (&bdb->bi_cache);
if ( bdb->bi_idl_cache_max_size ) {
@ -650,6 +647,8 @@ bdb_db_destroy( BackendDB *be )
if( bdb->bi_dbenv_home ) ch_free( bdb->bi_dbenv_home );
if( bdb->bi_db_config_path ) ch_free( bdb->bi_db_config_path );
bdb_attr_index_destroy( bdb->bi_attrs );
ldap_pvt_thread_rdwr_destroy ( &bdb->bi_cache.c_rwlock );
ldap_pvt_thread_mutex_destroy( &bdb->bi_cache.lru_mutex );
ldap_pvt_thread_mutex_destroy( &bdb->bi_cache.c_dntree.bei_kids_mutex );