Free attribute validators on shutdown

This commit is contained in:
Nikita Popov 2020-06-05 10:36:35 +02:00
parent d3eeeb6882
commit 5b4c4bbe3b
3 changed files with 8 additions and 0 deletions

View file

@ -32,6 +32,7 @@
#include "zend_smart_str.h"
#include "zend_smart_string.h"
#include "zend_cpuinfo.h"
#include "zend_attributes.h"
static size_t global_map_ptr_last = 0;
@ -1077,6 +1078,7 @@ void zend_shutdown(void) /* {{{ */
zend_hash_destroy(GLOBAL_CONSTANTS_TABLE);
free(GLOBAL_CONSTANTS_TABLE);
zend_shutdown_strtod();
zend_attributes_shutdown();
#ifdef ZTS
GLOBAL_FUNCTION_TABLE = NULL;

View file

@ -144,3 +144,8 @@ void zend_register_attribute_ce(void)
zend_compiler_attribute_register(zend_ce_php_attribute, zend_attribute_validate_phpattribute);
}
void zend_attributes_shutdown(void)
{
zend_hash_destroy(&internal_validators);
}

View file

@ -65,5 +65,6 @@ static zend_always_inline zend_attribute *zend_add_class_constant_attribute(zend
}
void zend_register_attribute_ce(void);
void zend_attributes_shutdown(void);
#endif