Deleting array?

From: Date: Wed, 29 Sep 1999 08:06:17 +0000
Subject: Deleting array?
Groups: php.dev 
Request: Send a blank email to php-dev+get-11377@lists.php.net to get a copy of this message
Hi, I have written some code in the hyperwave module which uses an associated array as a temporary internal data structure. The array is created at the beginning of a function: 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); and should be removed at the end of that function: zend_hash_destroy(spec_arr->value.ht); efree(spec_arr); I wonder if this is the right way, because it still leaks memory: zend_hash.c(190) : Freeing 0x0833E750 (4 bytes), script=/usr/local/apache/htdocs/hw/leak.php3 Last leak repeated 3 times zend_hash.c(180) : Freeing 0x0833E6F0 (41 bytes), script=/usr/local/apache/htdocs/hw/leak.php3 Last leak repeated 3 times zend_API.c(231) : Freeing 0x0833E6A8 (20 bytes), script=/usr/local/apache/htdocs/hw/leak.php3 Last leak repeated 3 times zend_hash.c(100) : Freeing 0x0833DB18 (20 bytes), script=/usr/local/apache/htdocs/hw/leak.php3 zend_API.c(192) : Freeing 0x081E1C08 (44 bytes), script=/usr/local/apache/htdocs/hw/leak.php3 BTW, this is in ext/hyperwave/hw.c, function make2_return_array_from_objrec() Uwe -- Uwe.Steinmann@fernuni-hagen.de Tel: +2331 987 4528 Fax: +2331 987 375

« previous php.dev (#11377) next »