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 );