diff --git a/src/controller/CHIPDeviceControllerFactory.cpp b/src/controller/CHIPDeviceControllerFactory.cpp index a631ebdc5752fd..67f125270529fe 100644 --- a/src/controller/CHIPDeviceControllerFactory.cpp +++ b/src/controller/CHIPDeviceControllerFactory.cpp @@ -210,6 +210,11 @@ CHIP_ERROR DeviceControllerFactory::ServiceEvents() } DeviceControllerFactory::~DeviceControllerFactory() +{ + Shutdown(); +} + +void DeviceControllerFactory::Shutdown() { if (mSystemState != nullptr) { diff --git a/src/controller/CHIPDeviceControllerFactory.h b/src/controller/CHIPDeviceControllerFactory.h index eb9b668ce27999..68de0144909e2e 100644 --- a/src/controller/CHIPDeviceControllerFactory.h +++ b/src/controller/CHIPDeviceControllerFactory.h @@ -91,6 +91,7 @@ class DeviceControllerFactory } CHIP_ERROR Init(FactoryInitParams params); + void Shutdown(); CHIP_ERROR SetupController(SetupParams params, DeviceController & controller); CHIP_ERROR SetupCommissioner(SetupParams params, DeviceCommissioner & commissioner);