diff options
Diffstat (limited to 'sapi/cli/php_cli.c')
-rw-r--r-- | sapi/cli/php_cli.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index 306e143f2c..420e355b43 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -537,6 +537,20 @@ int main(int argc, char *argv[]) void ***tsrm_ls; #endif +#if defined(PHP_WIN32) && defined(_DEBUG) && defined(PHP_WIN32_DEBUG_HEAP) + { + int tmp_flag; + + _CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE); + _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDERR); + + tmp_flag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); + tmp_flag |= _CRTDBG_DELAY_FREE_MEM_DF; + tmp_flag |= _CRTDBG_LEAK_CHECK_DF; + + _CrtSetDbgFlag(tmp_flag); + } +#endif #ifdef HAVE_SIGNAL_H #if defined(SIGPIPE) && defined(SIG_IGN) |