From 40cca2379e678b89151d17c4ac90690d5cc082ed Mon Sep 17 00:00:00 2001 From: Davide Beatrici Date: Sun, 14 Oct 2018 03:19:12 +0200 Subject: [PATCH] hamcorebuilder.c: check for "_DEBUG" macro and don't enable memcheck --- src/hamcorebuilder/hamcorebuilder.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/hamcorebuilder/hamcorebuilder.c b/src/hamcorebuilder/hamcorebuilder.c index c11546c6..d6f79fc1 100644 --- a/src/hamcorebuilder/hamcorebuilder.c +++ b/src/hamcorebuilder/hamcorebuilder.c @@ -136,8 +136,12 @@ int main(int argc, char *argv[]) { MayaquaMinimalMode(); -#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