freeing zvals
| From: | Klaus Reimer | Date: | Wed, 06 Mar 2002 12:30:17 +0000 |
| Subject: | freeing zvals | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-80791@lists.php.net to get a copy of this message | ||
Hi,
just a simple question. If I am creating zvals like this:
zval *zExample;
MAKE_STD_ZVAL(zExample);
do I have to free this zval manually (With FREE_ZVAL(zExample)) or is this
done automatically? Or it is done automatically only if this zval is exported
to user space? I ask because I have trouble with freeing zvals. I create two
zvals in the modules init-function. ONE of those zvals I am exporting to the
global symbol table. In the modules shutdown function I want to free those
zvals. But I get a segfault after script execution, if I'm freeing the
exported zval. The local zval (which is not accesible from the PHP script)
can be freed without problems.
Currently it looks to me, that I don't need to free zvals which I have
exported to a symbol table, because PHP already frees the zval on module
shutdown. Is that correct? Or do I need to remove the zval from the symbol
table and then free the zval manually? How it is done correctly?
--
Bye, K <http://www.ailis.de/~k/>
[A735 47EC D87B 1F15 C1E9 53D3 AA03 6173 A723 E391]
(Finger k@ailis.de to get public key)