Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reset all device objects on controller shutdown (#7894)
Browse files Browse the repository at this point in the history
pan-apple authored and pull[bot] committed Jul 7, 2021

Verified

This commit was signed with the committer’s verified signature. The key has expired.
jonhoo Jon Gjengset
1 parent fe1577b commit 1492828
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
@@ -411,6 +411,8 @@ void Device::Reset()
}

SetActive(false);
mCASESession.Clear();

mState = ConnectionState::NotConnected;
mSessionManager = nullptr;
mStatusDelegate = nullptr;
5 changes: 5 additions & 0 deletions src/controller/CHIPDeviceController.cpp
Original file line number Diff line number Diff line change
@@ -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(),

0 comments on commit 1492828

Please sign in to comment.