digest->val[digest_len] = 0;
efree(hash->context);
hash->context = NULL;
-
- //???
- //??? /* zend_list_REAL_delete() */
- //??? if (zend_hash_index_find(&EG(regular_list), Z_RESVAL_P(zhash), (void *) &le)==SUCCESS) {
- //??? /* This is a hack to avoid letting the resource hide elsewhere (like in separated vars)
- //??? FETCH_RESOURCE is intelligent enough to handle dealing with any issues this causes */
- //??? le->refcount = 1;
- //??? } /* FAILURE is not an option */
zend_list_close(Z_RES_P(zhash));
if (raw_output) {
RETURN_FALSE;
}
- if ((le = zend_hash_index_find_ptr(&EG(regular_list), Z_RES_HANDLE_P(result))) == NULL || le->type != le_result) {
+ le = Z_RES_P(result);
+ if (le->type != le_result) {
php_error_docref(NULL, E_WARNING, "Supplied resource is not a valid ldap result resource");
RETURN_FALSE;
}
return &url_stream_wrappers_hash;
}
-static int _php_stream_release_context(zval *zv, void *pContext)
-{
- zend_resource *le = Z_RES_P(zv);
- if (le->ptr == pContext) {
- return --GC_REFCOUNT(le) == 0;
- }
- return 0;
-}
-
static int forget_persistent_resource_id_numbers(zval *el)
{
php_stream *stream;
stream->res = NULL;
- if (PHP_STREAM_CONTEXT(stream)) {
- zend_hash_apply_with_argument(&EG(regular_list),
- _php_stream_release_context,
- PHP_STREAM_CONTEXT(stream));
- stream->ctx = NULL;
+ if (stream->ctx) {
+ zend_list_delete(stream->ctx);
}
return 0;
PHPAPI int _php_stream_free_enclosed(php_stream *stream_enclosed, int close_options) /* {{{ */
{
- return _php_stream_free(stream_enclosed,
+ return php_stream_free(stream_enclosed,
close_options | PHP_STREAM_FREE_IGNORE_ENCLOSING);
}
/* }}} */
/* we force PHP_STREAM_CALL_DTOR because that's from where the
* enclosing stream can free this stream. We remove rsrc_dtor because
* we want the enclosing stream to be deleted from the resource list */
- return _php_stream_free(enclosing_stream,
+ return php_stream_free(enclosing_stream,
(close_options | PHP_STREAM_FREE_CALL_DTOR) & ~PHP_STREAM_FREE_RSRC_DTOR);
}