]> granicus.if.org Git - apache/commitdiff
mpm_unix(es): cleanup properly on exit in one_process mode.
authorYann Ylavic <ylavic@apache.org>
Thu, 2 Nov 2017 21:49:43 +0000 (21:49 +0000)
committerYann Ylavic <ylavic@apache.org>
Thu, 2 Nov 2017 21:49:43 +0000 (21:49 +0000)
We can't destroy ap_pglobal because clean_child_exit() runs in DSO which would
be unloaded under us, so use atexit() to defer the final apr_terminate().

[Reverted by 1822535]

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

server/mpm/event/event.c
server/mpm/prefork/prefork.c
server/mpm/worker/worker.c

index 0bf2dbe7755236be660be7c5bd20e0e71a8b882f..d57e771c7e7a72aec6d2c6901a09df4e24a8df58 100644 (file)
@@ -732,6 +732,7 @@ static void clean_child_exit(int code)
 
     if (one_process) {
         event_note_child_killed(/* slot */ 0, 0, 0);
+        atexit(apr_terminate);
     }
 
     exit(code);
index f9b9933bd32cd6385d65b9eed5209f3e7caf414c..649cc97d63b7096777a80d607f2014e3f2324978 100644 (file)
@@ -230,6 +230,7 @@ static void clean_child_exit(int code)
 
     if (one_process) {
         prefork_note_child_killed(/* slot */ 0, 0, 0);
+        atexit(apr_terminate);
     }
 
     ap_mpm_pod_close(my_bucket->pod);
index 3b93f3ceac59d227893629c6c68fbd44911499cd..c87c003c7e5c7912b6c3bbaee41e028c9e089ecb 100644 (file)
@@ -436,6 +436,7 @@ static void clean_child_exit(int code)
 
     if (one_process) {
         worker_note_child_killed(/* slot */ 0, 0, 0);
+        atexit(apr_terminate);
     }
 
     exit(code);