diff options
author | gstein <gstein@13f79535-47bb-0310-9956-ffa450edef68> | 2001-01-19 09:56:32 +0000 |
---|---|---|
committer | gstein <gstein@13f79535-47bb-0310-9956-ffa450edef68> | 2001-01-19 09:56:32 +0000 |
commit | 43f4696effef9a6bcc8f7a8bff530766048bb0d9 (patch) | |
tree | edc948fab9e2631d3387f6bba957088215327082 /dso/beos | |
parent | 222eb751877f2a35eddaaf6990af87dd84c1ab25 (diff) | |
download | libapr-43f4696effef9a6bcc8f7a8bff530766048bb0d9.tar.gz |
watch out for a double-unload. one manually from apr_dso_unload(), followed
by one through the pool cleanup.
1) protect the unload by setting/checking the handle to NULL
2) unload "runs" the cleanup to also remove it from the pool cleanup
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@61078 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'dso/beos')
-rw-r--r-- | dso/beos/dso.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/dso/beos/dso.c b/dso/beos/dso.c index 4306db765..6fdc4cd75 100644 --- a/dso/beos/dso.c +++ b/dso/beos/dso.c @@ -59,7 +59,12 @@ static apr_status_t dso_cleanup(void *thedso) { apr_dso_handle_t *dso = thedso; - return apr_dso_unload(dso); + + if (dso->handle != NULL && unload_add_on(dso->handle) < B_NO_ERROR) + return APR_EINIT; + dso->handle = NULL; + + return APR_SUCCESS; } APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char *path, @@ -81,10 +86,7 @@ APR_DECLARE(apr_status_t) apr_dso_load(apr_dso_handle_t **res_handle, const char APR_DECLARE(apr_status_t) apr_dso_unload(apr_dso_handle_t *handle) { - if(unload_add_on(handle->handle) < B_NO_ERROR) - return APR_EINIT; - - return APR_SUCCESS; + return apr_run_cleanup(handle->cont, handle, dso_cleanup); } APR_DECLARE(apr_status_t) apr_dso_sym(apr_dso_handle_sym_t *ressym, apr_dso_handle_t *handle, |