mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
try not to crash when closing persistent sockets, because EG(persistent_list)
is cleaned before the extensions' MSHUTDOWNs are called.
This commit is contained in:
parent
3cddf1d7b5
commit
c3019a16d5
1 changed files with 9 additions and 1 deletions
|
@ -932,7 +932,15 @@ mysqlnd_net_free(MYSQLND_NET * const net TSRMLS_DC)
|
||||||
if (net->stream) {
|
if (net->stream) {
|
||||||
DBG_INF_FMT("Freeing stream. abstract=%p", net->stream->abstract);
|
DBG_INF_FMT("Freeing stream. abstract=%p", net->stream->abstract);
|
||||||
if (pers) {
|
if (pers) {
|
||||||
php_stream_free(net->stream, PHP_STREAM_FREE_CLOSE_PERSISTENT | PHP_STREAM_FREE_RSRC_DTOR);
|
if (EG(active)) {
|
||||||
|
php_stream_free(net->stream, PHP_STREAM_FREE_CLOSE_PERSISTENT | PHP_STREAM_FREE_RSRC_DTOR);
|
||||||
|
} else {
|
||||||
|
/*
|
||||||
|
otherwise we will crash because the EG(persistent_list) has been freed already,
|
||||||
|
before the modules are shut down
|
||||||
|
*/
|
||||||
|
php_stream_free(net->stream, PHP_STREAM_FREE_CLOSE | PHP_STREAM_FREE_RSRC_DTOR);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
php_stream_free(net->stream, PHP_STREAM_FREE_CLOSE);
|
php_stream_free(net->stream, PHP_STREAM_FREE_CLOSE);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue