!!! This should also be merged into 5.3, I prepared it, please tell me if it is ok to commit !!!
{
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);
}
#endif
+ sapi_shutdown();
tsrm_shutdown();
log_error(LOG_INFORM, "php6_close", NULL, NULL, "Shutdown PHP Module");