From c65ab754f33c235110a34d80cd7bae9c5dde4994 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Mon, 14 Jun 2021 18:48:01 -0400 Subject: [PATCH] Shut down InteractionModelEngine during DeviceController shutdown. Otherwise if we have an IM action in flight at shutdown time we will effectively leak the object managing it, and after a few shutdown/restart cycles for the stack not be able to send any more IM actions. --- src/controller/CHIPDeviceController.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/controller/CHIPDeviceController.cpp b/src/controller/CHIPDeviceController.cpp index 356b5bace489ba..51e59c92eb053a 100644 --- a/src/controller/CHIPDeviceController.cpp +++ b/src/controller/CHIPDeviceController.cpp @@ -312,6 +312,10 @@ CHIP_ERROR DeviceController::Shutdown() mState = State::NotInitialized; + // Shut down the interaction model before we try shuttting down the exchange + // manager. + app::InteractionModelEngine::GetInstance()->Shutdown(); + // TODO(#6668): Some exchange has leak, shutting down ExchangeManager will cause a assert fail. // if (mExchangeMgr != nullptr) // {