From ec34d9928c5361d5cb664ae78bf1927ee348a4fb Mon Sep 17 00:00:00 2001 From: Daniel Buckmaster Date: Tue, 8 Jul 2014 17:39:22 +0200 Subject: [PATCH] Only check memory if a flag is set. --- Engine/source/testing/unitTesting.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Engine/source/testing/unitTesting.cpp b/Engine/source/testing/unitTesting.cpp index 70d4f2b58..0c42577ac 100644 --- a/Engine/source/testing/unitTesting.cpp +++ b/Engine/source/testing/unitTesting.cpp @@ -88,8 +88,10 @@ DefineConsoleFunction( runAllUnitTests, int, (),, // Release the default listener. delete listeners.Release( listeners.default_result_printer() ); - // Add the memory leak tester. - listeners.Append( new testing::MemoryLeakDetector ); + if ( Con::getBoolVariable( "$testing::checkMemoryLeaks", false ) ) { + // Add the memory leak tester. + listeners.Append( new testing::MemoryLeakDetector ); + } // Add the Torque unit test listener. listeners.Append( new TorqueUnitTestListener );