diff --git a/include/internal/catch_leak_detector.cpp b/include/internal/catch_leak_detector.cpp index dd160d9c..7a30e8a1 100644 --- a/include/internal/catch_leak_detector.cpp +++ b/include/internal/catch_leak_detector.cpp @@ -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(); +} diff --git a/include/internal/catch_leak_detector.h b/include/internal/catch_leak_detector.h index bfb0b429..633457ac 100644 --- a/include/internal/catch_leak_detector.h +++ b/include/internal/catch_leak_detector.h @@ -11,6 +11,7 @@ namespace Catch { struct LeakDetector { LeakDetector(); + ~LeakDetector(); }; }