bhyde 99/10/07 07:32:09
Modified: src/main http_main.c Log: Man! This file vastly improved. Thanks Dean! Use the abstraction API_EXPORT_NONSTD for exporting main (aka apache_main). Use clear rather than destroy on ptemp as other 'systolic' pools do. That also fixing a leak of the first ptemp created. Let the destroy of pglobal to all the cleanup. Meanwhile, all exit paths should destroy pglobal so the cleanup/unwind gets run and this routine sets a bad example by having many exits that don't - another day. Revision Changes Path 1.10 +4 -9 apache-2.0/src/main/http_main.c Index: http_main.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/http_main.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- http_main.c 1999/10/06 21:26:53 1.9 +++ http_main.c 1999/10/07 14:32:06 1.10 @@ -237,10 +237,9 @@ extern char *optarg; #ifdef WIN32 -__declspec(dllexport) - int apache_main(int argc, char *argv[]) +API_EXPORT_NONSTD(int) apache_main(int argc, char *argv[]) #else -int main(int argc, char **argv) +API_EXPORT_NONSTD(int) main(int argc, char *argv[]) #endif { int c; @@ -339,21 +338,17 @@ for (;;) { ap_clear_pool(pconf); - ap_create_context(&ptemp, pconf); + ap_clear_pool(ptemp); ap_server_root = def_server_root; ap_run_pre_config(pconf, plog, ptemp); server_conf = ap_read_config(pconf, ptemp, confname); ap_clear_pool(plog); ap_run_open_logs(pconf, plog, ptemp, server_conf); ap_post_config_hook(pconf, plog, ptemp, server_conf); - ap_destroy_pool(ptemp); if (ap_mpm_run(pconf, plog, server_conf)) break; } - - ap_clear_pool(pconf); - ap_clear_pool(plog); - ap_destroy_pool(pglobal); + ap_destroy_pool(pglobal); /* and destroy all descendent pools */ exit(0); }