]> granicus.if.org Git - apache/commitdiff
A bit more cleanup
authorBill Stoddard <stoddard@apache.org>
Wed, 13 Mar 2002 03:00:22 +0000 (03:00 +0000)
committerBill Stoddard <stoddard@apache.org>
Wed, 13 Mar 2002 03:00:22 +0000 (03:00 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93888 13f79535-47bb-0310-9956-ffa450edef68

modules/experimental/mod_mem_cache.c

index eb1228fd7a9e7a6893fe8f918e0fed24cd63eb48..3c29a4d1616061acfbabeca637f3a922baf041a9 100644 (file)
@@ -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;