ZEND_MINIT_FUNCTION and ZEND_INIT_MODULE_GLOBALS question: additi onal info
| From: | Marc Boeren | Date: | Tue, 27 Feb 2001 13:04:03 +0000 |
| Subject: | ZEND_MINIT_FUNCTION and ZEND_INIT_MODULE_GLOBALS question: additi onal info | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-47609@lists.php.net to get a copy of this message | ||
I can see where the problem is coming from:
the global that is freed is of type zval *
and allocated (eg in the ZEND_MINIT_FUNCTION) using
MAKE_STD_ZVAL...
the auto-cleanup works per request, and cleans up everything
that is allocated with emalloc... also what was intended to be global.
This probably means I have to work around it. OK.
Cheerio, Marc.
>Hi!
>
>I'm writing a php-module that uses some globals.
>
>I use the ZEND_MINIT_FUNCTION as sort of a constructor, and
>call ZEND_INIT_MODULE_GLOBALS here.
>When my module ends, the ZEND_MSHUTDOWN_FUNCTION is
>called, but the globals are already destroyed by then!
>
>In ZEND_INIT_MODULE_GLOBALS, I've defined the ctor and dtor
>functions. The ctor function gets called, but the dtor function NOT.
>
>Effectively, this gives me no way to control destruction of my own
>globals, unless I've missed something???
>
>Can anyone help me with this? I'm developing under VC6.0 and the
>thread-safe stuff.
>
>Thanks, Marc.