Freeing zval
| From: | Uwe Steinmann | Date: | Mon, 04 Oct 1999 13:55:20 +0000 |
| Subject: | Freeing zval | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-5125@lists.php.net to get a copy of this message | ||
Hi,
I would like to use a zval internally to store some data.
For this I create an array and fill it with some data:
MAKE_STD_ZVAL(spec_arr);
array_init(spec_arr);
add_assoc_long(spec_arr, "Title", HW_ATTR_LANG);
add_assoc_long(spec_arr, "Description", HW_ATTR_LANG);
add_assoc_long(spec_arr, "Keyword", HW_ATTR_LANG);
add_assoc_long(spec_arr, "Group", HW_ATTR_NONE);
In order to get rid of it I currently do the following:
spec_arr->refcount--;
zend_hash_destroy(spec_arr->value.ht);
efree(spec_arr);
and I wonder if this is the way to do it. There seems to
be at least one problem because it leaks 44 bytes (can
see what else could cause it).
Any comments?
Uwe
PS: The code can be found in ext/hyperwave/hw.c:283
--
Uwe.Steinmann@fernuni-hagen.de
Tel: +2331 987 4528 Fax: +2331 987 375