From ee42c383b1169311b60862b7277dcdb640706844 Mon Sep 17 00:00:00 2001 From: Bill Stoddard Date: Wed, 13 Mar 2002 03:00:22 +0000 Subject: [PATCH] A bit more cleanup git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93888 13f79535-47bb-0310-9956-ffa450edef68 --- modules/experimental/mod_mem_cache.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/modules/experimental/mod_mem_cache.c b/modules/experimental/mod_mem_cache.c index eb1228fd7a..3c29a4d161 100644 --- a/modules/experimental/mod_mem_cache.c +++ b/modules/experimental/mod_mem_cache.c @@ -223,10 +223,8 @@ static apr_status_t cleanup_cache_mem(void *sconfv) for (hi = apr_hash_first(NULL, co->cacheht); hi; hi=apr_hash_next(hi)) { apr_hash_this(hi, NULL, NULL, (void **)&obj); if (obj) { - if (obj->refcount) { - obj->cleanup = 1; - } - else { + obj->cleanup = 1; + if (!obj->refcount) { cleanup_cache_object(obj); } } @@ -390,12 +388,11 @@ static int open_entity(cache_handle_t *h, request_rec *r, const char *type, cons } obj = (cache_object_t *) apr_hash_get(sconf->cacheht, key, APR_HASH_KEY_STRING); - if (obj) { - mem_cache_object_t *mobj = (mem_cache_object_t *) obj->vobj; if (obj->complete) { obj->refcount++; - apr_pool_cleanup_register(r->pool, obj, decrement_refcount, apr_pool_cleanup_null); + apr_pool_cleanup_register(r->pool, obj, decrement_refcount, + apr_pool_cleanup_null); } else { obj = NULL; -- 2.40.0