summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2004-02-10 17:55:32 +0000
committerZeev Suraski <zeev@php.net>2004-02-10 17:55:32 +0000
commitb8a990ace79598de7f0abcfa3eab4c6806cc1dcc (patch)
treefdbb02307d3cc73783784dcaf632d258366c111d
parent9c1be88844f04f3cff3e841e39a93552ba779eff (diff)
downloadphp-git-b8a990ace79598de7f0abcfa3eab4c6806cc1dcc.tar.gz
Fix report_memleaks
-rw-r--r--main/config.w32.h1
-rw-r--r--main/main.c8
2 files changed, 6 insertions, 3 deletions
diff --git a/main/config.w32.h b/main/config.w32.h
index fcaa7218aa..7ef05a7fae 100644
--- a/main/config.w32.h
+++ b/main/config.w32.h
@@ -189,6 +189,7 @@
#define PHP_SHLIB_SUFFIX "dll"
#define HAVE_SQLDATASOURCES
#define POSIX_MALLOC_THRESHOLD 10
+//#define HAVE_SOCKLEN_T 1
/* Win32 supports strcoll */
#define HAVE_STRCOLL 1
diff --git a/main/main.c b/main/main.c
index 7cd2e57511..e2ad368b41 100644
--- a/main/main.c
+++ b/main/main.c
@@ -952,7 +952,7 @@ static void php_message_handler_for_zend(long message, void *data)
break;
case ZMSG_MEMORY_LEAKS_GRAND_TOTAL:
#if ZEND_DEBUG
- if ((EG(error_reporting)&E_WARNING) && PG(report_memleaks)) {
+ if ((EG(error_reporting) & E_WARNING) && PG(report_memleaks)) {
char memory_leak_buf[512];
snprintf(memory_leak_buf, 512, "=== Total %d memory leaks detected ===\n", *((zend_uint *) data));
@@ -1200,8 +1200,10 @@ void php_request_shutdown_for_hook(void *dummy)
*/
void php_request_shutdown(void *dummy)
{
+ zend_bool report_memleaks;
TSRMLS_FETCH();
+ report_memleaks = PG(report_memleaks);
/* EG(opline_ptr) points into nirvana and therefore cannot be safely accessed
* inside zend_executor callback functions.
*/
@@ -1244,8 +1246,8 @@ void php_request_shutdown(void *dummy)
sapi_deactivate(TSRMLS_C);
} zend_end_try();
- zend_try {
- shutdown_memory_manager(CG(unclean_shutdown), 0 TSRMLS_CC);
+ zend_try {
+ shutdown_memory_manager(CG(unclean_shutdown) || !report_memleaks, 0 TSRMLS_CC);
} zend_end_try();
zend_try {