Name

ap_register_cleanup — register a cleanup function

Synopsis

void ap_register_cleanup(pool *p, void *data, void (*plain_cleanup)(void *), 
void (*child_cleanup)(void *))

Registers a pair of functions to be called when the pool is destroyed. Pools can be destroyed for two reasons: first, because the server has finished with that pool, in which case it destroys it and calls the plain_cleanup function, or second, because the server has forked and is preparing to exec some other program, in which case the child_cleanup function is called. In either case, data is passed as the only argument to the cleanup function. If either of these cleanups is not required, use ap_null_cleanup.