apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dr...@apache.org
Subject cvs commit: apr/memory/unix apr_sms.c
Date Sun, 10 Jun 2001 14:37:38 GMT
dreid       01/06/10 07:37:38

  Modified:    memory/unix apr_sms.c
  Log:
  Fix the cleanup logic.
  
  Revision  Changes    Path
  1.17      +5 -7      apr/memory/unix/apr_sms.c
  
  Index: apr_sms.c
  ===================================================================
  RCS file: /home/cvs/apr/memory/unix/apr_sms.c,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- apr_sms.c	2001/06/08 02:34:34	1.16
  +++ apr_sms.c	2001/06/10 14:37:38	1.17
  @@ -578,28 +578,26 @@
       cleanup = mem_sys->cleanups;
       cleanup_ref = &mem_sys->cleanups;
       while (cleanup) {
  -        if ((type == 0 || cleanup->cleanup_fn == cleanup_fn) &&
  +        if ((type == 0 || cleanup->type == type) &&
               cleanup->data == data && cleanup->cleanup_fn == cleanup_fn) {
               *cleanup_ref = cleanup->next;
   
  -            apr_lock_release(mem_sys->sms_lock);
  -            
               mem_sys = mem_sys->accounting_mem_sys;
   
               if (mem_sys->free_fn)
                   apr_sms_free(mem_sys, cleanup);
   
               rv = APR_SUCCESS;
  +        } else {
  +            cleanup_ref = &cleanup->next;
  +            cleanup = cleanup->next;
           }
  -
  -        cleanup_ref = &cleanup->next;
  -        cleanup = cleanup->next;
       }
   
       apr_lock_release(mem_sys->sms_lock);
   
       /* The cleanup function must have been registered previously */
  -    return APR_EINVAL;
  +    return rv;
   }
   
   APR_DECLARE(apr_status_t) apr_sms_cleanup_unregister_type(apr_sms_t *mem_sys, 
  
  
  

Mime
View raw message