*/
AP_DECLARE_HOOK(void,optional_fn_retrieve,(void))
+/**
+ * A generic pool cleanup that will reset a pointer to NULL. For use with
+ * apr_pool_cleanup_register.
+ * @param data The address of the pointer
+ * @return APR_SUCCESS
+ */
+AP_DECLARE(apr_status_t) ap_pool_cleanup_set_null(void *data);
+
#ifdef __cplusplus
}
#endif
const command_rec *cmd;
};
-static apr_status_t reload_conf_hash(void *baton)
-{
- ap_config_hash = NULL;
- return APR_SUCCESS;
-}
-
static void rebuild_conf_hash(apr_pool_t *p, int add_prelinked)
{
module **m;
ap_config_hash = apr_hash_make(p);
- apr_pool_cleanup_register(p, NULL, reload_conf_hash,
+ apr_pool_cleanup_register(p, &ap_config_hash, ap_pool_cleanup_set_null,
apr_pool_cleanup_null);
if (add_prelinked) {
for (m = ap_prelinked_modules; *m != NULL; m++) {
return pl->write_fd;
}
-/* clear_handle_list() is called when plog is cleared; at that
- * point we need to forget about our old list of pipe read
- * handles. We let the plog cleanups close the actual pipes.
- */
-static apr_status_t clear_handle_list(void *v)
-{
- read_handles = NULL;
- return APR_SUCCESS;
-}
-
/* remember to close this handle in the child process
*
* On Win32 this makes zero sense, because we don't
* between log phases, so we don't mind losing stderr's
* read_handle a little bit early.
*/
- apr_pool_cleanup_register(p, NULL, clear_handle_list,
+ apr_pool_cleanup_register(p, &read_handles, ap_pool_cleanup_set_null,
apr_pool_cleanup_null);
/* HERE we need a stdout log that outlives plog.
);
return has_body;
}
+
+AP_DECLARE(apr_status_t) ap_pool_cleanup_set_null(void *data_)
+{
+ void **ptr = (void **)data_;
+ *ptr = NULL;
+}
*/
static apr_hash_t *mxcfg_by_type;
-static apr_status_t cleanup_mx_hash(void *dummy)
-{
- mxcfg_by_type = NULL;
- return APR_SUCCESS;
-}
-
AP_DECLARE_NONSTD(void) ap_mutex_init(apr_pool_t *p)
{
mutex_cfg_t *def;
}
mxcfg_by_type = apr_hash_make(p);
- apr_pool_cleanup_register(p, NULL, cleanup_mx_hash, apr_pool_cleanup_null);
+ apr_pool_cleanup_register(p, &mxcfg_by_type, ap_pool_cleanup_set_null,
+ apr_pool_cleanup_null);
/* initialize default mutex configuration */
def = apr_pcalloc(p, sizeof *def);