diff options
| -rw-r--r-- | main/main.c | 19 | 
1 files changed, 18 insertions, 1 deletions
| diff --git a/main/main.c b/main/main.c index 8131a891d5..ac25719838 100644 --- a/main/main.c +++ b/main/main.c @@ -867,10 +867,10 @@ static void php_message_handler_for_zend(long message, void *data)  			break;  		case ZMSG_MEMORY_LEAK_DETECTED:  		case ZMSG_MEMORY_LEAK_REPEATED: { +#if ZEND_DEBUG  				TSRMLS_FETCH();  				if ((EG(error_reporting)&E_WARNING) && PG(report_memleaks)) { -#if ZEND_DEBUG  					char memory_leak_buf[512];  					if (message==ZMSG_MEMORY_LEAK_DETECTED) { @@ -894,9 +894,26 @@ static void php_message_handler_for_zend(long message, void *data)  #	else  					fprintf(stderr, "%s", memory_leak_buf);  #	endif +				} +			}  #endif +			break; +		case ZMSG_MEMORY_LEAKS_GRAND_TOTAL: { +#if ZEND_DEBUG +				TSRMLS_FETCH(); + +				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)); +#	if defined(PHP_WIN32) +					OutputDebugString(memory_leak_buf); +#	else +					fprintf(stderr, "%s", memory_leak_buf); +#	endif  				}  			} +#endif  			break;  		case ZMSG_LOG_SCRIPT_NAME: {  				struct tm *ta, tmbuf; | 
