diff options
Diffstat (limited to 'dso')
-rw-r--r-- | dso/aix/dso.c | 9 | ||||
-rw-r--r-- | dso/beos/dso.c | 9 | ||||
-rw-r--r-- | dso/unix/dso.c | 9 | ||||
-rw-r--r-- | dso/win32/dso.c | 9 |
4 files changed, 36 insertions, 0 deletions
diff --git a/dso/aix/dso.c b/dso/aix/dso.c index cd63af0b1..98425c6c1 100644 --- a/dso/aix/dso.c +++ b/dso/aix/dso.c @@ -132,6 +132,12 @@ struct dl_info { * add the basic "wrappers" here. */ +static apr_status_t dso_cleanup(void *thedso) +{ + apr_dso_handle_t *dso = thedso; + return apr_dso_unload(dso); +} + APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char *path, apr_pool_t *ctx) { @@ -143,6 +149,9 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, *res_handle = apr_pcalloc(ctx, sizeof(*res_handle)); (*res_handle)->handle = (void*)os_handle; (*res_handle)->cont = ctx; + + apr_register_cleanup(ctx, *res_handle, dso_cleanup, apr_null_cleanup); + return APR_SUCCESS; } diff --git a/dso/beos/dso.c b/dso/beos/dso.c index bb01d858c..4306db765 100644 --- a/dso/beos/dso.c +++ b/dso/beos/dso.c @@ -56,6 +56,12 @@ #if APR_HAS_DSO +static apr_status_t dso_cleanup(void *thedso) +{ + apr_dso_handle_t *dso = thedso; + return apr_dso_unload(dso); +} + APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char *path, apr_pool_t *ctx) { @@ -67,6 +73,9 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char *res_handle = apr_pcalloc(ctx, sizeof(*res_handle)); (*res_handle)->handle = newid; (*res_handle)->cont = ctx; + + apr_register_cleanup(ctx, *res_handle, dso_cleanup, apr_null_cleanup); + return APR_SUCCESS; } diff --git a/dso/unix/dso.c b/dso/unix/dso.c index 154a11fb0..ada9c314f 100644 --- a/dso/unix/dso.c +++ b/dso/unix/dso.c @@ -61,6 +61,12 @@ #include <stddef.h> #endif +static apr_status_t dso_cleanup(void *thedso) +{ + apr_dso_handle_t *dso = thedso; + return apr_dso_unload(dso); +} + APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char *path, apr_pool_t *ctx) { @@ -88,6 +94,9 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, (*res_handle)->handle = (void*)os_handle; (*res_handle)->cont = ctx; (*res_handle)->errormsg = NULL; + + apr_register_cleanup(ctx, *res_handle, dso_cleanup, apr_null_cleanup); + return APR_SUCCESS; } diff --git a/dso/win32/dso.c b/dso/win32/dso.c index 3899fa223..a2ba47ddb 100644 --- a/dso/win32/dso.c +++ b/dso/win32/dso.c @@ -59,6 +59,12 @@ #if APR_HAS_DSO +static apr_status_t dso_cleanup(void *thedso) +{ + apr_dso_handle_t *dso = thedso; + return apr_dso_unload(dso); +} + APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, const char *path, apr_pool_t *ctx) { @@ -111,6 +117,9 @@ APR_DECLARE(apr_status_t) apr_dso_load(struct apr_dso_handle_t **res_handle, (*res_handle)->handle = (void*)os_handle; (*res_handle)->cont = ctx; (*res_handle)->load_error = APR_SUCCESS; + + apr_register_cleanup(ctx, *res_handle, dso_cleanup, apr_null_cleanup); + return APR_SUCCESS; } |