From: Derick Rethans Date: Thu, 14 Jul 2011 12:21:15 +0000 (+0000) Subject: - Added a check for an enviroment variable (ZEND_DONT_UNLOAD_MODULES) that, if X-Git-Tag: php-5.4.0alpha3~134 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4e5960ed8893d3a906bf4cd63fafdd6b31a9b389;p=php - Added a check for an enviroment variable (ZEND_DONT_UNLOAD_MODULES) that, if set, prevents PHP from dl_closing() modules on shutdown. - This makes it possible to spot memory leaks with valgrind in shared modules. --- diff --git a/Zend/zend_API.c b/Zend/zend_API.c index cacfcfb9ff..9e4385f079 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2266,7 +2266,7 @@ void module_destructor(zend_module_entry *module) /* {{{ */ #if HAVE_LIBDL #if !(defined(NETWARE) && defined(APACHE_1_BUILD)) - if (module->handle) { + if (module->handle && !getenv("ZEND_DONT_UNLOAD_MODULES")) { DL_UNLOAD(module->handle); } #endif