]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Man! This file vastly improved. Thanks Dean!
authorBen Hyde <bhyde@apache.org>
Thu, 7 Oct 1999 14:32:06 +0000 (14:32 +0000)
committerBen Hyde <bhyde@apache.org>
Thu, 7 Oct 1999 14:32:06 +0000 (14:32 +0000)
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.
PR:
Obtained from:
Submitted by:
Reviewed by:

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@83939 13f79535-47bb-0310-9956-ffa450edef68

server/main.c

index 60ee4e4a266d4c9c20abc0309ddb19865e582909..44e031fceac12dd50c817c851c23d6c1ddcc2c46 100644 (file)
@@ -237,10 +237,9 @@ ap_context_t *g_pHookPool;
 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 @@ int main(int argc, char **argv)
 
     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);
 }