Prechádzať zdrojové kódy

Only check memory if a flag is set.

Daniel Buckmaster 11 rokov pred
rodič
commit
ec34d9928c
1 zmenil súbory, kde vykonal 4 pridanie a 2 odobranie
  1. 4 2
      Engine/source/testing/unitTesting.cpp

+ 4 - 2
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 );