On 2001-05-12 10:12:14, "Andi Gutmans" <[EMAIL PROTECTED]> wrote:
> The code is almost OK. The only problem is that the reference count and
> is_ref from rfcbuf->headers are also copied to *headers. So what you
should
> be doing (if you only add it once to the return_value) is to do
> INIT_PZVAL(headers) before the hash_update so that they are reset to
> refcount=1 is_ref=0.
Like this?
zval * headers;
MAKE_STD_ZVAL(headers);
*headers = *rfcbuf->headers;
INIT_PZVAL(headers);
if (zval_copy_ctor(headers) == SUCCESS) {
zend_hash_update(HASH_OF(return_value), "headers",
sizeof("headers"), &headers, sizeof(headers)
NULL);
}
> And by the way, zval_copy_ctor does recursive copy constructing so your
> code is OK.
Great; that's a relief :-)
Thanks!
--Wez.
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]