]> granicus.if.org Git - php/commitdiff
- Added a check for an enviroment variable (ZEND_DONT_UNLOAD_MODULES) that, if
authorDerick Rethans <derick@php.net>
Thu, 14 Jul 2011 12:21:15 +0000 (12:21 +0000)
committerDerick Rethans <derick@php.net>
Thu, 14 Jul 2011 12:21:15 +0000 (12:21 +0000)
  set, prevents PHP from dl_closing() modules on shutdown.
- This makes it possible to spot memory leaks with valgrind in shared modules.

Zend/zend_API.c

index cacfcfb9ff24d7acf9bf6ce5c4200160a41f71c7..9e4385f079b1fa0b85f210f59e7d74677f4c9448 100644 (file)
@@ -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