mirror of
https://github.com/php/php-src.git
synced 2024-11-29 04:46:07 +08:00
Fix memory leak in non-ZTS mode.
This commit is contained in:
parent
ef236a936f
commit
a60968287c
@ -76,12 +76,10 @@ static void php_pcre_init_globals(zend_pcre_globals *pcre_globals TSRMLS_DC)
|
||||
zend_hash_init(&pcre_globals->pcre_cache, 0, NULL, php_free_pcre_cache, 1);
|
||||
}
|
||||
|
||||
#ifdef ZTS
|
||||
static void php_pcre_shutdown_globals(zend_pcre_globals *pcre_globals TSRMLS_DC)
|
||||
{
|
||||
zend_hash_destroy(&pcre_globals->pcre_cache);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
static /* {{{ PHP_MINFO_FUNCTION(pcre) */
|
||||
@ -113,6 +111,10 @@ static PHP_MINIT_FUNCTION(pcre)
|
||||
/* {{{ PHP_MSHUTDOWN_FUNCTION(pcre) */
|
||||
static PHP_MSHUTDOWN_FUNCTION(pcre)
|
||||
{
|
||||
#ifndef ZTS
|
||||
php_pcre_shutdown_globals(&pcre_globals TSRMLS_CC);
|
||||
#endif
|
||||
|
||||
return SUCCESS;
|
||||
}
|
||||
/* }}} */
|
||||
|
Loading…
Reference in New Issue
Block a user