}
/* }}} */
+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;
#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;