summaryrefslogtreecommitdiff
path: root/sapi/nsapi
diff options
context:
space:
mode:
authorUwe Schindler <thetaphi@php.net>2009-03-23 23:13:14 +0000
committerUwe Schindler <thetaphi@php.net>2009-03-23 23:13:14 +0000
commit0935ae193c3cc2b97fef7a010a472fb4985c0ab7 (patch)
treea53cec4a8b803567e685e115ec4ac17cb09708a9 /sapi/nsapi
parent79c44de0caac18b5f42c1fd95e2387f6b8efa4b2 (diff)
downloadphp-git-0935ae193c3cc2b97fef7a010a472fb4985c0ab7.tar.gz
MFH: Fix a sigsegv on server shutdown, add missing sapi_shutdown().
Diffstat (limited to 'sapi/nsapi')
-rw-r--r--sapi/nsapi/nsapi.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sapi/nsapi/nsapi.c b/sapi/nsapi/nsapi.c
index 95e07a41a2..eea290b01c 100644
--- a/sapi/nsapi/nsapi.c
+++ b/sapi/nsapi/nsapi.c
@@ -468,6 +468,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);
@@ -882,6 +887,7 @@ void NSAPI_PUBLIC php5_close(void *vparam)
}
#endif
+ sapi_shutdown();
tsrm_shutdown();
log_error(LOG_INFORM, "php5_close", NULL, NULL, "Shutdown PHP Module");