cvs: php4 /ext/mcrypt mcrypt.c
| From: | Sterling Hughes | Date: | Fri, 07 Sep 2001 10:25:27 +0000 |
| Subject: | cvs: php4 /ext/mcrypt mcrypt.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-7276@lists.php.net to get a copy of this message | ||
sterling Fri Sep 7 06:25:27 2001 EDT
Modified files:
/php4/ext/mcrypt mcrypt.c
Log:
register a list destructor
Index: php4/ext/mcrypt/mcrypt.c
diff -u php4/ext/mcrypt/mcrypt.c:1.58 php4/ext/mcrypt/mcrypt.c:1.59
--- php4/ext/mcrypt/mcrypt.c:1.58 Fri Sep 7 03:31:39 2001
+++ php4/ext/mcrypt/mcrypt.c Fri Sep 7 06:25:26 2001
@@ -244,12 +244,22 @@
PHP_INI_END()
#endif
+static void php_mcrypt_module_dtor(zend_rsrc_list_entry *rsrc)
+{
+ MCRYPT td = (MCRYPT) rsrc->ptr;
+ mcrypt_module_close (td);
+}
+
+
static PHP_MINIT_FUNCTION(mcrypt)
{
#if defined(ZTS) && defined(HAVE_LIBMCRYPT24)
ZEND_INIT_MODULE_GLOBALS(mcrypt, NULL, NULL);
Z_TYPE(mcrypt_module_entry) = type;
#endif
+
+ MCG(le_h) = zend_register_list_destructors_ex(php_mcrypt_module_dtor, NULL, "mcrypt",
module_number);
+
/* modes for mcrypt_??? routines */
REGISTER_LONG_CONSTANT("MCRYPT_ENCRYPT", 0, CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("MCRYPT_DECRYPT", 1, CONST_PERSISTENT);