mirror of
https://github.com/php/php-src.git
synced 2024-12-04 07:14:10 +08:00
Fix persistent stream closing (that one took me at least 3 days)
This commit is contained in:
parent
b296a3bd64
commit
bff63db577
@ -238,6 +238,11 @@ fprintf(stderr, "stream_alloc: %s:%p persistent=%s\n", ops->label, ret, persiste
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
int _php_stream_free_persistend(list_entry *le, void *pStream TSRMLS_DC)
|
||||
{
|
||||
return le->ptr == pStream;
|
||||
}
|
||||
|
||||
PHPAPI int _php_stream_free(php_stream *stream, int close_options TSRMLS_DC) /* {{{ */
|
||||
{
|
||||
int ret = 1;
|
||||
@ -364,6 +369,10 @@ fprintf(stderr, "stream_free: %s:%p[%s] preserve_handle=%d release_cast=%d remov
|
||||
#else
|
||||
pefree(stream, stream->is_persistent);
|
||||
#endif
|
||||
if (stream->is_persistent) {
|
||||
/* we don't work with *stream but need its value for comparison */
|
||||
zend_hash_apply_with_argument(&EG(persistent_list), (apply_func_arg_t) _php_stream_free_persistend, stream TSRMLS_CC);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
Loading…
Reference in New Issue
Block a user