Skip to content

Commit

Permalink
Reset all device objects on controller shutdown (#7894)
Browse files Browse the repository at this point in the history
  • Loading branch information
pan-apple authored Jun 25, 2021
1 parent e013877 commit 336533f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/controller/CHIPDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,8 @@ void Device::Reset()
}

SetActive(false);
mCASESession.Clear();

mState = ConnectionState::NotConnected;
mSessionManager = nullptr;
mStatusDelegate = nullptr;
Expand Down
5 changes: 5 additions & 0 deletions src/controller/CHIPDeviceController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,11 @@ CHIP_ERROR DeviceController::Shutdown()

ChipLogDetail(Controller, "Shutting down the controller");

for (uint32_t i = 0; i < kNumMaxActiveDevices; i++)
{
mActiveDevices[i].Reset();
}

#if CONFIG_DEVICE_LAYER
//
// We can safely call PlatformMgr().Shutdown(), which like DeviceController::Shutdown(),
Expand Down

0 comments on commit 336533f

Please sign in to comment.