jwoolley 02/04/15 19:30:09
Modified: buckets apr_buckets_alloc.c
Log:
Follow the usual pattern (eg apr/file_io/unix/open.c) for cleanups.
Submitted by: Jeff Trawick
Revision Changes Path
1.8 +6 -7 apr-util/buckets/apr_buckets_alloc.c
Index: apr_buckets_alloc.c
===================================================================
RCS file: /home/cvs/apr-util/buckets/apr_buckets_alloc.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -u -r1.7 -r1.8
--- apr_buckets_alloc.c 10 Apr 2002 16:53:38 -0000 1.7
+++ apr_buckets_alloc.c 16 Apr 2002 02:30:09 -0000 1.8
@@ -79,7 +79,11 @@
static apr_status_t alloc_cleanup(void *data)
{
- apr_bucket_alloc_destroy(data);
+ apr_bucket_alloc_t *list = data;
+ apr_allocator_t *allocator = list->allocator;
+
+ apr_allocator_free(allocator, list->blocks);
+ apr_allocator_destroy(allocator);
return APR_SUCCESS;
}
@@ -106,12 +110,7 @@
APU_DECLARE_NONSTD(void) apr_bucket_alloc_destroy(apr_bucket_alloc_t *list)
{
- apr_allocator_t *allocator = list->allocator;
-
- apr_pool_cleanup_kill(list->pool, list, alloc_cleanup);
-
- apr_allocator_free(allocator, list->blocks);
- apr_allocator_destroy(allocator);
+ apr_pool_cleanup_run(list->pool, list, alloc_cleanup);
}
APU_DECLARE_NONSTD(void *) apr_bucket_alloc(apr_size_t size,