]> granicus.if.org Git - php/commitdiff
Fix memory leak in non-ZTS mode.
authorAndrei Zmievski <andrei@php.net>
Sat, 9 Nov 2002 00:43:37 +0000 (00:43 +0000)
committerAndrei Zmievski <andrei@php.net>
Sat, 9 Nov 2002 00:43:37 +0000 (00:43 +0000)
ext/pcre/php_pcre.c

index e3489415bd3c19b37283f3911c98ad664dc60462..4c83ad8a49c4b8eea35ed93fa1cc97074a1e4c69 100644 (file)
@@ -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;
 }
 /* }}} */