diff options
author | striker <striker@13f79535-47bb-0310-9956-ffa450edef68> | 2002-03-19 15:30:07 +0000 |
---|---|---|
committer | striker <striker@13f79535-47bb-0310-9956-ffa450edef68> | 2002-03-19 15:30:07 +0000 |
commit | 93ed3f31bb7b39f9e2c3f04fff67138f9567310d (patch) | |
tree | d7d9af95a87ebc7aead0fc0eacb617e736da4fa1 /memory | |
parent | c6a66a2e1e64496c61b2b14da3177fd82d430c68 (diff) | |
download | libapr-93ed3f31bb7b39f9e2c3f04fff67138f9567310d.tar.gz |
Fix the fix...
apr_allocator_destroy wasn't the one using the invalid lock, it was
apr_allocator_free, which was being called a few lines above my
previous fix.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63157 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'memory')
-rw-r--r-- | memory/unix/apr_pools.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/memory/unix/apr_pools.c b/memory/unix/apr_pools.c index 8ef86debc..a0b48025d 100644 --- a/memory/unix/apr_pools.c +++ b/memory/unix/apr_pools.c @@ -677,6 +677,15 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) allocator = pool->allocator; active = pool->self; +#if APR_HAS_THREADS + if (apr_allocator_get_owner(allocator) == pool) { + /* Make sure to remove the lock, since it is highly likely to + * be invalid now. + */ + apr_allocator_set_mutex(allocator, NULL); + } +#endif /* APR_HAS_THREADS */ + /* Free all the nodes in the pool (including the node holding the * pool struct), by giving them back to the allocator. */ @@ -688,13 +697,6 @@ APR_DECLARE(void) apr_pool_destroy(apr_pool_t *pool) * in the allocator, it will have been destroyed by the cleanup function. */ if (apr_allocator_get_owner(allocator) == pool) { -#if APR_HAS_THREADS - /* Make sure to remove the lock, since it is highly likely to - * be invalid now. - */ - apr_allocator_set_mutex(allocator, NULL); -#endif /* APR_HAS_THREADS */ - apr_allocator_destroy(allocator); } } |