From cvs-return-1523-apmail-apr-cvs-archive=apr.apache.org@apr.apache.org Fri Jun 29 16:07:45 2001 Return-Path: Delivered-To: apmail-apr-cvs-archive@apr.apache.org Received: (qmail 19957 invoked by uid 500); 29 Jun 2001 16:07:38 -0000 Mailing-List: contact cvs-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: dev@apr.apache.org Delivered-To: mailing list cvs@apr.apache.org Received: (qmail 19908 invoked by uid 1103); 29 Jun 2001 16:07:34 -0000 Date: 29 Jun 2001 16:07:34 -0000 Message-ID: <20010629160734.19902.qmail@apache.org> From: dreid@apache.org To: apr-cvs@apache.org Subject: cvs commit: apr/memory/unix apr_sms.c dreid 01/06/29 09:07:34 Modified: memory/unix apr_sms.c Log: Fix a bug in the cleanup code. Check for the APR_ALL_CLEANUPS instead of 0. Revision Changes Path 1.26 +4 -3 apr/memory/unix/apr_sms.c Index: apr_sms.c =================================================================== RCS file: /home/cvs/apr/memory/unix/apr_sms.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- apr_sms.c 2001/06/20 15:52:15 1.25 +++ apr_sms.c 2001/06/29 16:07:32 1.26 @@ -614,7 +614,7 @@ cleanup = sms->cleanups; cleanup_ref = &sms->cleanups; while (cleanup) { - if ((type == 0 || cleanup->type == type) && + if ((type == APR_ALL_CLEANUPS || cleanup->type == type) && cleanup->data == data && cleanup->cleanup_fn == cleanup_fn) { *cleanup_ref = cleanup->next; @@ -623,6 +623,7 @@ if (sms->free_fn) apr_sms_free(sms, cleanup); + cleanup = *cleanup_ref; rv = APR_SUCCESS; } else { cleanup_ref = &cleanup->next; @@ -651,7 +652,7 @@ cleanup_ref = &sms->cleanups; sms = sms->accounting; while (cleanup) { - if (type == 0 || cleanup->type == type) { + if (type == APR_ALL_CLEANUPS || cleanup->type == type) { *cleanup_ref = cleanup->next; if (sms->free_fn) @@ -702,7 +703,7 @@ cleanup_ref = &sms->cleanups; sms = sms->accounting; while (cleanup) { - if (type == 0 || cleanup->type == type) { + if (type == APR_ALL_CLEANUPS || cleanup->type == type) { *cleanup_ref = cleanup->next; cleanup->cleanup_fn(cleanup->data);