Index: mod_axis2.c =================================================================== --- mod_axis2.c (revision 629362) +++ mod_axis2.c (working copy) @@ -425,6 +425,19 @@ #endif } +typedef struct worker_cleanup_data +{ + const axutil_env_t * env; + axis2_apache2_worker_t * worker; +} worker_cleanup_data_t; + +static apr_status_t worker_cleanup(void *data) +{ + worker_cleanup_data_t *d = (worker_cleanup_data_t *) data; + axis2_apache2_worker_free(d->worker, d->env); + return APR_SUCCESS; +} + static int axis2_post_config(apr_pool_t *pconf, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *svr_rec) { @@ -592,6 +605,14 @@ "[Axis2] Error creating mod_axis2 apache2 worker"); exit(APEXIT_CHILDFATAL); } + else + { + worker_cleanup_data_t *data = apr_palloc(pconf, sizeof(worker_cleanup_data_t)); + data->env = axutil_env; + data->worker = axis2_worker; + apr_pool_cleanup_register(pconf, data, worker_cleanup, apr_pool_cleanup_null); + } + return OK; }