mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-04-06 15:00:40 +08:00
Free thread keys in reverse order of allocation
This commit is contained in:
parent
2ec71598cd
commit
2298595ea3
@ -720,12 +720,7 @@ ldap_int_thread_pool_wrapper (
|
||||
}
|
||||
}
|
||||
|
||||
for ( i=0; i<MAXKEYS && uctx.ltu_key[i].ltk_key; i++ ) {
|
||||
if (uctx.ltu_key[i].ltk_free)
|
||||
uctx.ltu_key[i].ltk_free(
|
||||
uctx.ltu_key[i].ltk_key,
|
||||
uctx.ltu_key[i].ltk_data );
|
||||
}
|
||||
ldap_pvt_thread_pool_context_reset(&uctx);
|
||||
|
||||
thread_keys[keyslot].ctx = NULL;
|
||||
thread_keys[keyslot].id = tid_zero;
|
||||
@ -895,7 +890,9 @@ void ldap_pvt_thread_pool_context_reset( void *vctx )
|
||||
ldap_int_thread_userctx_t *ctx = vctx;
|
||||
int i;
|
||||
|
||||
for ( i=0; i<MAXKEYS && ctx->ltu_key[i].ltk_key; i++) {
|
||||
for ( i=MAXKEYS-1; i>=0; i--) {
|
||||
if ( !ctx->ltu_key[i].ltk_key )
|
||||
continue;
|
||||
if ( ctx->ltu_key[i].ltk_free )
|
||||
ctx->ltu_key[i].ltk_free( ctx->ltu_key[i].ltk_key,
|
||||
ctx->ltu_key[i].ltk_data );
|
||||
|
Loading…
x
Reference in New Issue
Block a user