diff --git a/src/controller/tests/TestDevice.cpp b/src/controller/tests/TestDevice.cpp index c1a5ab6d0d3112..dc7c0aa305dc74 100644 --- a/src/controller/tests/TestDevice.cpp +++ b/src/controller/tests/TestDevice.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -45,7 +46,7 @@ void TestDevice_EstablishSessionDirectly(nlTestSuite * inSuite, void * inContext SecureSessionMgr sessionMgr; ExchangeManager exchangeMgr; Inet::InetLayer inetLayer; - System::Layer systemLayer; + System::LayerImpl systemLayer; Ble::BleLayer blelayer; FabricTable fabrics; secure_channel::MessageCounterManager messageCounterManager; @@ -87,6 +88,15 @@ void TestDevice_EstablishSessionDirectly(nlTestSuite * inSuite, void * inContext device.OperationalCertProvisioned(); NL_TEST_ASSERT(inSuite, device.EstablishConnectivity(nullptr, nullptr) == CHIP_NO_ERROR); + + device.Reset(); + messageCounterManager.Shutdown(); + exchangeMgr.Shutdown(); + sessionMgr.Shutdown(); + transportMgr.Close(); + inetLayer.Shutdown(); + systemLayer.Shutdown(); + Platform::MemoryShutdown(); } // clang-format off