Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cherry-pick][ICD] Shutdown icd client storage when destroying android controller … #36481

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/app/icd/client/DefaultICDClientStorage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -542,5 +542,14 @@ CHIP_ERROR DefaultICDClientStorage::ProcessCheckInPayload(const ByteSpan & paylo
iterator->Release();
return CHIP_ERROR_NOT_FOUND;
}

void DefaultICDClientStorage::Shutdown()
{
mICDClientInfoIterators.ReleaseAll();
mpClientInfoStore = nullptr;
mpKeyStore = nullptr;
mFabricList.clear();
}

} // namespace app
} // namespace chip
6 changes: 6 additions & 0 deletions src/app/icd/client/DefaultICDClientStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ class DefaultICDClientStorage : public ICDClientStorage
CHIP_ERROR ProcessCheckInPayload(const ByteSpan & payload, ICDClientInfo & clientInfo,
Protocols::SecureChannel::CounterType & counter) override;

/**
* Shut down DefaultICDClientStorage
*
*/
void Shutdown();

#if CONFIG_BUILD_FOR_HOST_UNIT_TEST
size_t GetFabricListSize() { return mFabricList.size(); }

Expand Down
1 change: 1 addition & 0 deletions src/controller/java/AndroidDeviceControllerWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ using namespace TLV;

AndroidDeviceControllerWrapper::~AndroidDeviceControllerWrapper()
{
getICDClientStorage()->Shutdown();
mController->Shutdown();

#ifndef JAVA_MATTER_CONTROLLER_TEST
Expand Down
Loading