mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 20:27:11 +01:00 
			
		
		
		
	Catch::LeakDetector: added cleanup call to destructor
simple code with provided main function which just returns 0 leaks memory due to fact that singletons are not cleaned up running valgrind on such simple application reports that 752 bytes are still available in 11 blocks this commit adds destructor to Catch::LeakDetector which calls Catch::cleanUp()
This commit is contained in:
		 Jozef Grajciar
					Jozef Grajciar
				
			
				
					committed by
					
						 Martin Hořeňovský
						Martin Hořeňovský
					
				
			
			
				
	
			
			
			 Martin Hořeňovský
						Martin Hořeňovský
					
				
			
						parent
						
							054d356332
						
					
				
				
					commit
					ab98afe68b
				
			| @@ -6,6 +6,7 @@ | ||||
|  */ | ||||
|  | ||||
|  #include "catch_leak_detector.h" | ||||
|  #include "catch_interfaces_registry_hub.h" | ||||
|  | ||||
|  | ||||
| #ifdef CATCH_CONFIG_WINDOWS_CRTDBG | ||||
| @@ -30,3 +31,7 @@ namespace Catch { | ||||
|     Catch::LeakDetector::LeakDetector() {} | ||||
|  | ||||
| #endif | ||||
|  | ||||
| Catch::LeakDetector::~LeakDetector() { | ||||
|     Catch::cleanUp(); | ||||
| } | ||||
|   | ||||
| @@ -11,6 +11,7 @@ namespace Catch { | ||||
|  | ||||
|     struct LeakDetector { | ||||
|         LeakDetector(); | ||||
|         ~LeakDetector(); | ||||
|     }; | ||||
|  | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user