]> granicus.if.org Git - php/commitdiff
Fix a sigsegv on server shutdown, add missing sapi_shutdown().
authorUwe Schindler <thetaphi@php.net>
Fri, 20 Mar 2009 15:54:36 +0000 (15:54 +0000)
committerUwe Schindler <thetaphi@php.net>
Fri, 20 Mar 2009 15:54:36 +0000 (15:54 +0000)
sapi/nsapi/nsapi.c

index 62564e7fbd9a76b33a45121a18d8cdcaa0e8b69a..d5e070685d207119a986ae1409b071c7a7236578 100644 (file)
@@ -455,6 +455,11 @@ static void sapi_nsapi_flush(void *server_context)
 {
        nsapi_request_context *rc = (nsapi_request_context *)server_context;
        TSRMLS_FETCH();
+       
+       if (!rc) {
+               /* we have no context, so no flushing needed. This fixes a SIGSEGV on shutdown */
+               return;
+       }
 
        if (!SG(headers_sent)) {
                sapi_send_headers(TSRMLS_C);
@@ -826,6 +831,7 @@ void NSAPI_PUBLIC php5_close(void *vparam)
        }
 #endif 
 
+       sapi_shutdown();
        tsrm_shutdown();
 
        log_error(LOG_INFORM, "php5_close", NULL, NULL, "Shutdown PHP Module");