diff --git a/src/Cedar/SW.c b/src/Cedar/SW.c index 5ef29a47..06679fc8 100644 --- a/src/Cedar/SW.c +++ b/src/Cedar/SW.c @@ -783,8 +783,11 @@ UINT SWExec() MayaquaMinimalMode(); } -#ifdef DEBUG - InitMayaqua(true, true, 0, NULL); +#if defined(_DEBUG) || defined(DEBUG) // In VC++ compilers, the macro is "_DEBUG", not "DEBUG". + // If set memcheck = true, the program will be vitally slow since it will log all malloc() / realloc() / free() calls to find the cause of memory leak. + // For normal debug we set memcheck = false. + // Please set memcheck = true if you want to test the cause of memory leaks. + InitMayaqua(false, true, 0, NULL); #else InitMayaqua(false, false, 0, NULL); #endif diff --git a/src/Mayaqua/Microsoft.c b/src/Mayaqua/Microsoft.c index 6945939b..710cc9cd 100644 --- a/src/Mayaqua/Microsoft.c +++ b/src/Mayaqua/Microsoft.c @@ -4569,8 +4569,11 @@ void CALLBACK MsServiceDispatcher(DWORD argc, LPTSTR *argv) //// Initialization // Start of the Mayaqua -#ifdef DEBUG - InitMayaqua(true, true, 0, NULL); +#if defined(_DEBUG) || defined(DEBUG) // In VC++ compilers, the macro is "_DEBUG", not "DEBUG". + // If set memcheck = true, the program will be vitally slow since it will log all malloc() / realloc() / free() calls to find the cause of memory leak. + // For normal debug we set memcheck = false. + // Please set memcheck = true if you want to test the cause of memory leaks. + InitMayaqua(false, true, 0, NULL); #else InitMayaqua(false, false, 0, NULL); #endif @@ -4748,8 +4751,11 @@ UINT MsService(char *name, SERVICE_FUNCTION *start, SERVICE_FUNCTION *stop, UINT } // Start of the Mayaqua -#ifdef DEBUG - InitMayaqua(true, true, 0, NULL); +#if defined(_DEBUG) || defined(DEBUG) // In VC++ compilers, the macro is "_DEBUG", not "DEBUG". + // If set memcheck = true, the program will be vitally slow since it will log all malloc() / realloc() / free() calls to find the cause of memory leak. + // For normal debug we set memcheck = false. + // Please set memcheck = true if you want to test the cause of memory leaks. + InitMayaqua(false, true, 0, NULL); #else InitMayaqua(false, false, 0, NULL); #endif diff --git a/src/Mayaqua/Unix.c b/src/Mayaqua/Unix.c index 7ec8b234..10c4208b 100755 --- a/src/Mayaqua/Unix.c +++ b/src/Mayaqua/Unix.c @@ -2766,7 +2766,10 @@ RESTART_PROCESS: else if (argc >= 3 && StrCmpi(argv[1], UNIX_SVC_ARG_START) == 0 && StrCmpi(argv[2], UNIX_SVC_ARG_FOREGROUND) == 0) { #ifdef DEBUG - InitMayaqua(true, true, argc, argv); + // If set memcheck = true, the program will be vitally slow since it will log all malloc() / realloc() / free() calls to find the cause of memory leak. + // For normal debug we set memcheck = false. + // Please set memcheck = true if you want to test the cause of memory leaks. + InitMayaqua(false, true, argc, argv); #else InitMayaqua(false, false, argc, argv); #endif @@ -2786,7 +2789,10 @@ void UnixServiceMain(int argc, char *argv[], char *name, SERVICE_FUNCTION *start UINT mode = 0; // Start of the Mayaqua #ifdef DEBUG - InitMayaqua(true, true, argc, argv); + // If set memcheck = true, the program will be vitally slow since it will log all malloc() / realloc() / free() calls to find the cause of memory leak. + // For normal debug we set memcheck = false. + // Please set memcheck = true if you want to test the cause of memory leaks. + InitMayaqua(false, true, argc, argv); #else InitMayaqua(false, false, argc, argv); #endif diff --git a/src/vpncmd/vpncmd.c b/src/vpncmd/vpncmd.c index 96d751d1..dd23ad09 100644 --- a/src/vpncmd/vpncmd.c +++ b/src/vpncmd/vpncmd.c @@ -143,8 +143,11 @@ int main(int argc, char *argv[]) SetConsoleTitleA(CEDAR_PRODUCT_STR " VPN Command Line Utility"); #endif // OS_WIN32 -#ifdef DEBUG - InitMayaqua(true, true, argc, argv); +#if defined(_DEBUG) || defined(DEBUG) // In VC++ compilers, the macro is "_DEBUG", not "DEBUG". + // If set memcheck = true, the program will be vitally slow since it will log all malloc() / realloc() / free() calls to find the cause of memory leak. + // For normal debug we set memcheck = false. + // Please set memcheck = true if you want to test the cause of memory leaks. + InitMayaqua(false, true, argc, argv); #else InitMayaqua(false, false, argc, argv); #endif diff --git a/src/vpncmgr/vpncmgr.c b/src/vpncmgr/vpncmgr.c index 584b191e..7456937e 100644 --- a/src/vpncmgr/vpncmgr.c +++ b/src/vpncmgr/vpncmgr.c @@ -136,8 +136,11 @@ int PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrev, char *CmdLine, int CmdShow) { InitProcessCallOnce(); -#ifdef DEBUG - InitMayaqua(true, true, 0, NULL); +#if defined(_DEBUG) || defined(DEBUG) // In VC++ compilers, the macro is "_DEBUG", not "DEBUG". + // If set memcheck = true, the program will be vitally slow since it will log all malloc() / realloc() / free() calls to find the cause of memory leak. + // For normal debug we set memcheck = false. + // Please set memcheck = true if you want to test the cause of memory leaks. + InitMayaqua(false, true, 0, NULL); #else InitMayaqua(false, false, 0, NULL); #endif diff --git a/src/vpndrvinst/vpndrvinst.c b/src/vpndrvinst/vpndrvinst.c index 0411e8e7..2177758f 100644 --- a/src/vpndrvinst/vpndrvinst.c +++ b/src/vpndrvinst/vpndrvinst.c @@ -355,8 +355,11 @@ int PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrev, char *CmdLine, int CmdShow) { InitProcessCallOnce(); -#ifdef DEBUG - InitMayaqua(true, true, 0, NULL); +#if defined(_DEBUG) || defined(DEBUG) // In VC++ compilers, the macro is "_DEBUG", not "DEBUG". + // If set memcheck = true, the program will be vitally slow since it will log all malloc() / realloc() / free() calls to find the cause of memory leak. + // For normal debug we set memcheck = false. + // Please set memcheck = true if you want to test the cause of memory leaks. + InitMayaqua(false, true, 0, NULL); #else InitMayaqua(false, false, 0, NULL); #endif diff --git a/src/vpninstall/vpninstall.c b/src/vpninstall/vpninstall.c index 0164a2b7..e8059b56 100644 --- a/src/vpninstall/vpninstall.c +++ b/src/vpninstall/vpninstall.c @@ -1635,13 +1635,16 @@ int PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrev, char *CmdLine, int CmdShow) { INSTANCE *instance; InitProcessCallOnce(); -#ifdef DEBUG +#if defined(_DEBUG) || defined(DEBUG) // In VC++ compilers, the macro is "_DEBUG", not "DEBUG". is_debug = true; #else is_debug = false; #endif MayaquaMinimalMode(); - InitMayaqua(is_debug, is_debug, 0, NULL); + // If set memcheck = true, the program will be vitally slow since it will log all malloc() / realloc() / free() calls to find the cause of memory leak. + // For normal debug we set memcheck = false. + // Please set memcheck = true if you want to test the cause of memory leaks. + InitMayaqua(false, is_debug, 0, NULL); InitCedar(); ViSetSkip(); ViLoadStringTables(); diff --git a/src/vpnsmgr/vpnsmgr.c b/src/vpnsmgr/vpnsmgr.c index e6406861..5712000d 100644 --- a/src/vpnsmgr/vpnsmgr.c +++ b/src/vpnsmgr/vpnsmgr.c @@ -134,8 +134,11 @@ int PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrev, char *CmdLine, int CmdShow) { InitProcessCallOnce(); -#ifdef DEBUG - InitMayaqua(true, true, 0, NULL); +#if defined(_DEBUG) || defined(DEBUG) // In VC++ compilers, the macro is "_DEBUG", not "DEBUG". + // If set memcheck = true, the program will be vitally slow since it will log all malloc() / realloc() / free() calls to find the cause of memory leak. + // For normal debug we set memcheck = false. + // Please set memcheck = true if you want to test the cause of memory leaks. + InitMayaqua(false, true, 0, NULL); #else InitMayaqua(false, false, 0, NULL); #endif