From 9f9907b9a504b3e760c9581d4b02605ff807e0c1 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 15 Jun 2021 16:36:39 -0400 Subject: [PATCH] Shut down InteractionModelEngine during DeviceController shutdown. (#7629) 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) // {