Commit 2ca370df authored by Ryan Bloom's avatar Ryan Bloom
Browse files

Rely on the APR dso_load cleanup to unload the DSO correctly. There is

no reason for mod_so to register a second cleanup.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87737 13f79535-47bb-0310-9956-ffa450edef68
parent 4ccc704d
Loading
Loading
Loading
Loading
+0 −26
Original line number Diff line number Diff line
@@ -185,36 +185,12 @@ static apr_status_t unload_module(void *data)
    /* remove the module pointer from the core structure */
    ap_remove_loaded_module(modi->modp);

    /* unload the module space itself */
    if ((status = apr_dso_unload(modi->modp->dynamic_load_handle)) != APR_SUCCESS) {
        ap_log_perror(APLOG_MARK, APLOG_WARNING|APLOG_NOERRNO, 0, 
                      APR_GET_POOL(modi->modp->dynamic_load_handle),
		      "dso unload failure");
        return status;
    }

    /* destroy the module information */
    modi->modp = NULL;
    modi->name = NULL;
    return APR_SUCCESS;
}

/* 
 * This is the cleanup routine for files loaded by
 * load_file(). Unfortunately we don't keep a record of the filename
 * that was loaded, so we can't report the unload for debug purposes
 * or include the filename in error message.
 */

static apr_status_t unload_file(void *handle)
{
    apr_status_t status;
    
    if ((status = apr_dso_unload((apr_dso_handle_t *)handle)) != APR_SUCCESS)
        return status;
    return APR_SUCCESS;
}

/* 
 * This is called for the directive LoadModule and actually loads
 * a shared object file into the address space of the server process.
@@ -340,8 +316,6 @@ static const char *load_file(cmd_parms *cmd, void *dummy, const char *filename)
    ap_log_error(APLOG_MARK, APLOG_DEBUG|APLOG_NOERRNO, 0, NULL,
		 "loaded file %s", filename);

    apr_register_cleanup(cmd->pool, (void *)handle, unload_file, apr_null_cleanup);

    return NULL;
}