summaryrefslogtreecommitdiff
path: root/ext/mbstring/php_mbregex.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mbstring/php_mbregex.c')
-rw-r--r--ext/mbstring/php_mbregex.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c
index a2389df880..6b742560c5 100644
--- a/ext/mbstring/php_mbregex.c
+++ b/ext/mbstring/php_mbregex.c
@@ -65,7 +65,6 @@ static int _php_mb_regex_globals_ctor(zend_mb_regex_globals *pglobals)
{
pglobals->default_mbctype = ONIG_ENCODING_UTF8;
pglobals->current_mbctype = ONIG_ENCODING_UTF8;
- zend_hash_init(&(pglobals->ht_rc), 0, NULL, php_mb_regex_free_cache, 1);
ZVAL_UNDEF(&pglobals->search_str);
pglobals->search_re = (php_mb_regex_t*)NULL;
pglobals->search_pos = 0;
@@ -79,7 +78,6 @@ static int _php_mb_regex_globals_ctor(zend_mb_regex_globals *pglobals)
/* {{{ _php_mb_regex_globals_dtor */
static void _php_mb_regex_globals_dtor(zend_mb_regex_globals *pglobals)
{
- zend_hash_destroy(&pglobals->ht_rc);
}
/* }}} */
@@ -126,7 +124,9 @@ PHP_MSHUTDOWN_FUNCTION(mb_regex)
/* {{{ PHP_RINIT_FUNCTION(mb_regex) */
PHP_RINIT_FUNCTION(mb_regex)
{
- return MBSTRG(mb_regex_globals) ? SUCCESS: FAILURE;
+ if (!MBSTRG(mb_regex_globals)) return FAILURE;
+ zend_hash_init(&MBREX(ht_rc), 0, NULL, php_mb_regex_free_cache, 0);
+ return SUCCESS;
}
/* }}} */
@@ -145,7 +145,7 @@ PHP_RSHUTDOWN_FUNCTION(mb_regex)
onig_region_free(MBREX(search_regs), 1);
MBREX(search_regs) = (OnigRegion *)NULL;
}
- zend_hash_clean(&MBREX(ht_rc));
+ zend_hash_destroy(&MBREX(ht_rc));
return SUCCESS;
}