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 authored and Martin Hořeňovský committed 2018-10-18 11:47:21 +02:00
1 parent 054d356332
commit ab98afe68b
2 files changed
+6

No files matched your search

+5
View File
@@ -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();
}