summaryrefslogtreecommitdiff
path: root/ext/pcre
diff options
context:
space:
mode:
authorAndrei Zmievski <andrei@php.net>2002-11-09 00:43:37 +0000
committerAndrei Zmievski <andrei@php.net>2002-11-09 00:43:37 +0000
commita60968287c8be552d4ed52f3b2884f14a033cf71 (patch)
treeb64ec19efac346895563021e4ba53a15e067c33c /ext/pcre
parentef236a936fbb147d92fb1c239cdb344ba01e5cb7 (diff)
downloadphp-git-a60968287c8be552d4ed52f3b2884f14a033cf71.tar.gz
Fix memory leak in non-ZTS mode.
Diffstat (limited to 'ext/pcre')
-rw-r--r--ext/pcre/php_pcre.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index e3489415bd..4c83ad8a49 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -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;
}
/* }}} */